VS Code + Mudlet scripts development
Posted: Thu Oct 29, 2020 12:18 pm
Hey,
I've been trying to improve my developer experience while coding scripts for Mudlet. Since my scripts are extracted to .lua files and I keep my .xml content as minimal as possible I can leverage IDE power to do so. I was using (as for my daily work) Intellij Idea, although LUA support there feels a bit messy, regardless of plugin you chose. Recently I've been doing a lot work with own DSL created in Xtext and Eclipse Theia as IDE. Theia is web IDE based on Monaco Editor, hugely inspired (base) by VS Code (to that extent that VS code extensions can be used in Theia). While developing language server extension I gave VS Code a test ride. Although in terms of Java development it's not as powerful as Intellij, I tried LUA there. Right on spot. With LUA language server extension works far better, better go to definition etc. So I started do write language server for mudlet... which proved a bit problematic cranky, but not impossible to have two language servers give proposals. I've added few Mudlet api functions definitions and was going to import rest of them. Then I thought... well this is futile... I've just copied .lua files used for doc generation (github . com/Mudlet/Mudlet/tree/development/src/mudlet-lua/lua) to my project without including them in loader.
If there is more interest in the topic I can try to actually set up some package + description for development using .lua files.
I have converter to automate process of XML extraction to .lua files, so if anyone is interested I can try to make it more generic.
---
UPDATE:
I wrote VS Code extension for easier setup:
https://marketplace.visualstudio.com/it ... cripts-sdk
I've been trying to improve my developer experience while coding scripts for Mudlet. Since my scripts are extracted to .lua files and I keep my .xml content as minimal as possible I can leverage IDE power to do so. I was using (as for my daily work) Intellij Idea, although LUA support there feels a bit messy, regardless of plugin you chose. Recently I've been doing a lot work with own DSL created in Xtext and Eclipse Theia as IDE. Theia is web IDE based on Monaco Editor, hugely inspired (base) by VS Code (to that extent that VS code extensions can be used in Theia). While developing language server extension I gave VS Code a test ride. Although in terms of Java development it's not as powerful as Intellij, I tried LUA there. Right on spot. With LUA language server extension works far better, better go to definition etc. So I started do write language server for mudlet... which proved a bit problematic cranky, but not impossible to have two language servers give proposals. I've added few Mudlet api functions definitions and was going to import rest of them. Then I thought... well this is futile... I've just copied .lua files used for doc generation (github . com/Mudlet/Mudlet/tree/development/src/mudlet-lua/lua) to my project without including them in loader.
If there is more interest in the topic I can try to actually set up some package + description for development using .lua files.
I have converter to automate process of XML extraction to .lua files, so if anyone is interested I can try to make it more generic.
---
UPDATE:
I wrote VS Code extension for easier setup:
https://marketplace.visualstudio.com/it ... cripts-sdk