Page 1 of 1

Syntax coloring in VSCode?

Posted: Fri Aug 23, 2024 6:39 pm
by Travis
We were editing CIN files and CMD files in Visual Studio Code and, after adding some comments in the CIN file, were wondering about syntax coloring.

Has anyone developed a VSCode extension and/or grammars or anything related to syntax coloring for Vensim and/or SD-related files (e.g., XMILE)?

More info about what we're thinking is here:
https://code.visualstudio.com/api/langu ... ight-guide

It would be great to open a CIN file or a MDL file and have syntax coloring in a powerful text editor.

Anyone attempt this?

Re: Syntax coloring in VSCode?

Posted: Fri Aug 23, 2024 7:46 pm
by Administrator
I think Max Kleeman has done something like this, but not using VS Code.

Re: Syntax coloring in VSCode?

Posted: Fri Aug 23, 2024 8:29 pm
by tomfid
I did it once in Notepad++ ... I'll see if I can find it.

Re: Syntax coloring in VSCode?

Posted: Tue Aug 27, 2024 7:30 pm
by kleemax
I did a contribution on this at the 2024 International System Dynamics Conference. I am attaching the conference paper and the presentation.

I have developed prototypes in Notepad++ together with a former colleague of mine, Julian Emmerich.
It's on github:
https://github.com/julianM5/vensim_syntax_highlighting

It is highly desirable that similar things be implemented for other text editors such as VSCode, BBedit etc.
It would also be cool to see this implemented in Vensim's equation editor, with a possibility to turn it on and off.

Re: Syntax coloring in VSCode?

Posted: Sun Oct 20, 2024 5:31 am
by kleemax
My friend Julian Emmerich and I have now written up a word-document that contains the rules https://github.com/julianM5/vensim_synt ... /main/docs we have used for coloring syntax in the notepad++ prototype. It could be used as a basis/inspiration for syntax highlighting in VSCode. It would be helpful to Vensim users if syntax coloring for VSCode could also be published in github.