Red Warning Marks in asm/end Block in Delphi IDE

I am currently developing a web application using Delphi 12 and TMS Web Core.

I have encountered an issue where the Delphi IDE displays red warning marks (as if there are syntax errors) inside asm ... end blocks when I write JavaScript code. Although the application compiles and runs correctly, these red markers make it difficult to distinguish between actual syntax errors and false warnings, which leads to confusion during development.

I have seen TMS official YouTube videos demonstrating the use of asm ... end blocks, but in those videos, no red warning marks appear in the editor. Could you please let me know:

  1. Is there a recommended setting or configuration in Delphi IDE to suppress these red markers inside asm ... end blocks?
  2. Are there any differences in the development environment used in your videos that might explain the absence of these warnings?

I am aware of a workaround using {$IFNDEF MSWINDOWS} to exclude the block from Delphi’s parser, but I noticed that this was not used in your YouTube examples, so I would appreciate any clarification.

Thank you for your support.

Best regards,

as an alternative I use

{$IFDEF PAS2JS}
  asm
    $("#" + aElementId).addClass(AClassName);
  end;
{$ENDIF}
1 Like

Check on define PAS2JS is also what we tend to use internally.