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
VS Code + Mudlet scripts development
VS Code + Mudlet scripts development
Last edited by Delwing on Thu Sep 09, 2021 10:19 am, edited 1 time in total.
Re: VS Code + Mudlet scripts development
I'm definitely interested in the extraction from xml portion. I've got muddlet creating the xml fine but never found the time to do the reverse particularly well.
Though I'd want to go as far as pulling triggers/aliases/etc into the json format eventually. I just have too many irons in too many fires.
Though I'd want to go as far as pulling triggers/aliases/etc into the json format eventually. I just have too many irons in too many fires.
Re: VS Code + Mudlet scripts development
Little update on the matter, after some Discord discussion.
I've mentioned before VS Code Lua extension.
You can set Mudlet instalation dir (or in matter of fact any other dir with .lua files inside) as lib directory.
While Mudlet running get path:
```lua lfs.currentdir()```
And set this path in setting `Lua.workspace.library`
Not sure about Mac and Linux right now. You can always download .lua files that I've mentioned before and point to another directory that they will reside in.
I will try to automate docs retrieval from Wiki, since those files might be outdated. But oh, well, so far better than nothing![Wink ;)](./images/smilies/icon_e_wink.gif)
Demonic, I will try to generify my app to extract .xml
Be aware that it extracts only scripts, aliases and triggers. Didn't have need to add keybindings and timers.
I've mentioned before VS Code Lua extension.
You can set Mudlet instalation dir (or in matter of fact any other dir with .lua files inside) as lib directory.
While Mudlet running get path:
```lua lfs.currentdir()```
And set this path in setting `Lua.workspace.library`
Not sure about Mac and Linux right now. You can always download .lua files that I've mentioned before and point to another directory that they will reside in.
I will try to automate docs retrieval from Wiki, since those files might be outdated. But oh, well, so far better than nothing
![Wink ;)](./images/smilies/icon_e_wink.gif)
Demonic, I will try to generify my app to extract .xml
Be aware that it extracts only scripts, aliases and triggers. Didn't have need to add keybindings and timers.
Re: VS Code + Mudlet scripts development
Just head to https://github.com/Delwing/mudlet-docs
I've prepared package of` .lua` files with some basic instruction for VS Code.
Package is extracted directly from predefined pages in Mudlet Wiki. Geyser is not covered atm.
I've prepared package of` .lua` files with some basic instruction for VS Code.
Package is extracted directly from predefined pages in Mudlet Wiki. Geyser is not covered atm.
Re: VS Code + Mudlet scripts development
Can I ask how you go about setting this up?
I'm a little nubby about this. So, I'm guessing that maybe you have a single script in your package, top-level, that loads scripts that you need from there? I'm then guessing that if I do that, then I have to register my events manually from my external scripts? Like gmcp.Char stuff?
I'm a little nubby about this. So, I'm guessing that maybe you have a single script in your package, top-level, that loads scripts that you need from there? I'm then guessing that if I do that, then I have to register my events manually from my external scripts? Like gmcp.Char stuff?
Re: VS Code + Mudlet scripts development
gesslar - I will try to provide template project.
Basically all code lies in .lua files in project.
The only things I have in XML file are one-liners - calls to functions that are provided in .lua files.
Basically all code lies in .lua files in project.
The only things I have in XML file are one-liners - calls to functions that are provided in .lua files.
Re: VS Code + Mudlet scripts development
For easier setup, I've wrote VS Code extension that fetches docs:
https://marketplace.visualstudio.com/it ... cripts-sdk
https://marketplace.visualstudio.com/it ... cripts-sdk