VSCode snippets for coding Mudlet scripts

Post Reply
User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

VSCode snippets for coding Mudlet scripts

Post by demonnic »

I've spent a fair bit of time trying to get some tools and help setup for those who prefer to edit their Mudlet scripts in an external IDE or text editor for one reason or another. I was working on some Mudlet code of my own earlier this week when I decided I'd really like to add autocomplete for Mudlet script items to VSCode.

After looking at how to add basic autocomplete it seems VSCode wants you to setup an entire language server for that. So.

I made a cubic crap ton of snippets instead. I went through the json file that drives the Mudlet editor's autocomplete suggestions, made a snippet to make making snippets easier (SNIPCEPTION!), and got to work. 2300+ lines of json later, I have a full set of snippets covering everything that Mudlet's autocomplete includes. I set them up so that when you expand the snippets, each argument in the method is a tabstop. If the parameter is optional, I include the , with the parameter, so when you hit that tabstop you can just delete the default text and tab to the next stop.
The .code-snippets file is available on github, with instructions in the README, here: https://github.com/demonnic/MiscMudlet/ ... r/snippets

I tried to get them converted for Atom and Sublime Text using the Atomizr package for Atom but it was having some issues handling the conversions and I don't actually use those editors. It's a public git repo though if anyone wants to contribute. I have included some of my eventual goals for snippet coverage.

Some example gifs:

createGauge example
Image

Shows how I setup optional parameters
Image

User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

Re: VSCode snippets for coding Mudlet scripts

Post by demonnic »

added snippets for creating new Geyser objects.

Image

User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

Re: VSCode snippets for coding Mudlet scripts

Post by demonnic »

Added snippets for utf8 and string.xxx functions. Includes the : form of find, gmatch, gsub, split, starts, sub, and ends

User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

Re: VSCode snippets for coding Mudlet scripts

Post by demonnic »

Happy boxing day. Updated the repo with a file for table function snippets as well now.

User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

Re: VSCode snippets for coding Mudlet scripts

Post by demonnic »

Updated the base mudlet vscode snippets file with the new functions added in 4.5

Post Reply