Is there a TextMate grammar for DM Script development with Visual Studio?

66 Views Asked by At

Over the years, I have been using various versions of Visual Studio as the IDE for my multi-file DM script projects. The code editor in GMS3 makes this less necessary, but VS provides very nice integration with Git source control, so it is very helpful in this way alone. Because DMS syntax is not too far off from C#, using VS for C# has worked fairly well in this way (with minor customizations). The latest version of Visual Studio seems to be a bit more finicky about what sort of files it will interpret as C# and it seems the best approach would be to add custom language support for DM Script to Visual Studio via a TextMate grammar file. I am about to generate such a file and would be willing to share it, once ready, but maybe someone already has created one or knows where to download one?

1

There are 1 best solutions below

4
Mike Kundmann On

Although this answer does not provide a TextMate grammar for DM-script, it does share what I have found to be a very practical solution that does not require the addition of such a grammar. The solution is to adopt Visual Studio Code in place of the more specific Visual C# tools I have used in the past. I have only very recently come to realize that there are many benefits to using VS Code for DM-script projects (perhaps some followers of this tag have already discovered this years ago).

First of all, VS Code can be installed as a pure code-editing environment, without all the tools, options, and extra files required to build executables from specific types of source files (e.g. C#). This makes for a much simpler and more sensible IDE for DM-script, since all the building of (exectuble) script packages must ultimately be done within DM, anyway.

Secondly, VS Code is available in both Windows and MacOS versions since it does not inherently involve building targets for specific host operating systems. As far as I can tell, the Windows and MacOS versions of VS Code look and function identically. Even better, both are freely available to individual developers without charge.

Thirdly, although a basic installation of VS Code does not include build tools, it does still include the full integration with Git source control and the ability to link with remote repositories. (I have used it to link to existing remotes on both GitHub and Microsoft's Azure DevOps.)

Finally, and most importantly for the problem posed in this question, VS Code allows one to associate unrecognized files types to a specific language for the purposes of syntax highlighting, auto-completion, and code-folding. As mentioned above, treating DM-script as C# code works very well for these purposes and simply telling VS Code to treat files with a '.s' extension as C# activates all these nice code-editor features for DM scripts.

Below is a screenshot of one of my projects opened within VS Code:

enter image description here