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
Shows how I setup optional parameters
VSCode snippets for coding Mudlet scripts
Re: VSCode snippets for coding Mudlet scripts
added snippets for creating new Geyser objects.
Re: VSCode snippets for coding Mudlet scripts
Added snippets for utf8 and string.xxx functions. Includes the : form of find, gmatch, gsub, split, starts, sub, and ends
Re: VSCode snippets for coding Mudlet scripts
Happy boxing day. Updated the repo with a file for table function snippets as well now.
Re: VSCode snippets for coding Mudlet scripts
Updated the base mudlet vscode snippets file with the new functions added in 4.5