Discussion:
Editing M2 on Visual Studio Code, anyone?
(too old to reply)
trijezdci
2018-06-12 11:12:55 UTC
Permalink
Does anyone have a Modula-2/Oberon/Pascal syntax specification file for Visual Studio Code to do syntax highlighting?
Chris Burrows
2018-06-12 12:29:19 UTC
Permalink
Post by trijezdci
Does anyone have a Modula-2/Oberon/Pascal syntax specification file for Visual Studio Code to do syntax highlighting?
My understanding is that VS Code uses TextMate-compatible syntax specification files. Google modula2.tmLanguage or oberon.tmLanguage for some example specification files.

There are also a number of ready-made Oberon / FreePascal / Delphi VS Code extensions available in the VS Code marketplace.

When evaluating them I recommend using a simple test that we used when looking for Oberon syntax-editing specifications to use in our CPIde and Astrobe editors. i.e. can it handle nested comments?

If you have a working example, open a large file and insert '(*', or maybe '{' (for Delphi / FreePascal) at some arbitrary point. If it can't handle that then there is not much point looking any further.

Regards,
Chris Burrows
CFB Software
http://www.astrobe.com
trijezdci
2018-06-19 13:52:41 UTC
Permalink
Post by Chris Burrows
Post by trijezdci
Does anyone have a Modula-2/Oberon/Pascal syntax specification file for Visual Studio Code to do syntax highlighting?
My understanding is that VS Code uses TextMate-compatible syntax specification files. Google modula2.tmLanguage or oberon.tmLanguage for some example specification files.
Thanks. According to the information I have, VS Code uses JSON files. Even so, I have a complete set of TM specs for PIM, ISO and R10

https://github.com/m2sf/modula2.tmbundle/tree/master/Syntaxes

but VS Code does not seem to recognise them.

Then again, my .vscode directory happens to be completely empty and I wonder where MSFT has hidden all the default language specs. As usual, the MSFT online documentation is written only for Windows. The .vscode directory is empty. I have done a global search, I can't find the files.
Chris Burrows
2018-06-19 21:56:50 UTC
Permalink
Post by trijezdci
Then again, my .vscode directory happens to be completely empty and I wonder where MSFT has hidden all the default language specs. As usual, the MSFT online documentation is written only for Windows. The .vscode directory is empty. I have done a global search, I can't find the files.
On my system the extensions (and consequently the *.tmlanguage files) are stored in the following folder tree:

Program Files (x86)\
Microsoft Visual Studio\
2017\
Community\
Common7\
IDE\
Extensions\
uhuqfcub.t3o\
StarterKit\
Extensions

Alternatively search for *.tmLanguage in the 'Program Files (x86)' folder tree,

Regards,
Chris Burrows
CFB Software
http://www.cfbsoftware.com/modula2
trijezdci
2018-06-21 07:01:11 UTC
Permalink
Post by Chris Burrows
Post by trijezdci
Then again, my .vscode directory happens to be completely empty and I wonder where MSFT has hidden all the default language specs. As usual, the MSFT online documentation is written only for Windows. The .vscode directory is empty. I have done a global search, I can't find the files.
Program Files (x86)\
Thanks, but that looks like Windows to me. I don't use Windows and on my system the folder hierarchy looks nothing even remotely like it.

Like I said, I did a global search and there are no tmLanguage files anywhere (other than the Modula-2 ones I wrote myself which are in my development folder).
Marco van de Voort
2018-06-21 08:44:51 UTC
Permalink
Post by trijezdci
Thanks, but that looks like Windows to me. I don't use Windows and on my system the folder hierarchy looks nothing even remotely like it.
(moreover, it probably wasn't VS /code/, just proper native VS (community edition)
Chris Burrows
2018-06-22 08:29:17 UTC
Permalink
Post by Marco van de Voort
Post by trijezdci
Thanks, but that looks like Windows to me. I don't use Windows and on my system the folder hierarchy looks nothing even remotely like it.
(moreover, it probably wasn't VS /code/, just proper native VS (community edition)
Yes - that makes more sense. I had another look on my system and the VS Code extensions are stored in the <User folder>\.vscode\extensions folder. However, only the ones I have added are visible there. And, yes, they are javascript / json files.
trijezdci
2018-06-22 13:40:50 UTC
Permalink
Post by Chris Burrows
Post by Marco van de Voort
(moreover, it probably wasn't VS /code/, just proper native VS (community edition)
Yes - that makes more sense. I had another look on my system and the VS Code extensions are stored in the <User folder>\.vscode\extensions folder. However, only the ones I have added are visible there. And, yes, they are javascript / json files.
Indeed, I have a ~/.vscode/extensions directory but like I said, its empty and I can't find any files anywhere for the languages that come with VS Code.
Chris Burrows
2018-06-22 23:15:01 UTC
Permalink
Post by trijezdci
Indeed, I have a ~/.vscode/extensions directory but like I said, its empty and I can't find any files anywhere for the languages that come with VS Code.
On my Windows system they are located in C:\Program Files\Microsoft VS Code\resources\app\extensions folder subtree. I'm surprised that a system-wide search on your system didn't find any related .json files. Maybe a Linux / MacOS user here can throw some light on this?
Loading...