Delphi migration questions

Coming from Delphi, we are currently evaluating TMS Web Core to find out what the pros and cons are for VSC over Delphi and vice versa.

While evaluating the VSC version, the following questions came up:

  • How to do the Delphi "<ctrl>-<F9>", which only compiles but doesn't run the app?
  • How to do Delphi "F1" context help? There doesn't seem to be a help system at all provided with TMS Web Core for VSC. Would I need to install some Lazarus/FPC help stuff? If so, how?
  • OmiPascal has problems with ASM blocks, in particular when JavaScript "if" constructs are used. Is there a smart way to trick OmniPascal to accept the JS code in the ASM block? The following example is fatal for OmniPascal in that it says 'end' expected but found 'if'. After this error line, OmniPascal quits providing any further CodeInsight assistance.
   ASM
    if (E.FJSError===undefined)
     {
      if (E.stack===undefined) {
      stack = new Error().stack.toString().split(/\r\n|\n/);
      } else {
      stack = E.stack.toString().split(/\r\n|\n/);
      }
    } else {
      stack = E.FJSError.stack.toString().split(/\r\n|\n/);
    }
   END
  • OmniPascal does not understand Lazarus constructs like "Type helper for", as used e.g. in SysUtils. Any way to fix this?

Thank you and kind regards
Walter

Hello,
Regarding the keys, you can install the Delphi Keymap extension, which provides familiar shortcuts for you:

https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-keybindings

About F1, that works when you are on the form designer, focusing a control on the form, or a property in the object inspector and opening the help viewer with the right documentation.

About OmniPascal parsing, we will check with the OmniPascal developer to see if he will support those features and when.

Thanks!

Thank you Jose for these informations!

F1 context help now even works for standard library functions in that the internet docs wiki of Delphi is opened with the key word to search for. Good enough for me!

Regarding the ASM OmniPascal problem, I at least found a work around. When embracing the JS code with additional curly braces, OmniPascal is happy and it also doesn't seem to harm the JavaScript code. This would then look like this:

   ASM {
    if (E.FJSError===undefined)
     {
      if (E.stack===undefined) {
      stack = new Error().stack.toString().split(/\r\n|\n/);
      } else {
      stack = E.stack.toString().split(/\r\n|\n/);
      }
    } else {
      stack = E.FJSError.stack.toString().split(/\r\n|\n/);
    }
   } END

Notice the extra curlies after ASM and before END.

Smart solution indeed with curly braces to workaround the inability of OmniPascal (and also Delphi IDE LSP) to deal with JavaScript!