folding for conditional compiling #IfDef/#IfTrue stuff
can grey out the inactive conditional compilation branches
fill and wrap strings
snippets for starting new games/new objects/common extension points
compile your code and play in @Natrium729 's awesome Interactive Fiction Player
It’s packaged as:
a forked version of the inform6 compiler. This adds no features to the language or the compilation; it just provides lots of information about the code that the IDE needs.
a VSCode/VSCodium extension
Most of the features don’t require VSCode; if your editor can use a language server (many can), you can get most of the IDE-like features. If your editor can use TextMate bundles, you can get the syntax highlight (thanks to @Natrium729 ; my TextMate styling builds on that)
I"ve tested it working in IntelliJ, since that’s my normal preferred editor.
It’s version 0.9 — it’s got lots of features and tests for it, but I want to see other people using it without problems before putting it in the VSCode Extension marketplace and calling it 1.0.
About 50% of written by hand by me, and about 50% with lots of help from my robot friend, Claude. If you don’t want to use tools developed with AI, you may want to skip this.
Anyway, I hope this is useful for others, and please do let me know if there are feature requests or bugs or such: either a message here or as an issue on GitHub.
It’s neutral on which library you use – since it actually compiles your code for the IDE features, it shows correct info whether you’re using the standard library or PunyInform.
It may even be useful for reading I7-generated I6 code, but that’s not in scope for me; I know those files are long and complex and generally not examined or edited by humans.
The language server is far more modest of a tool, I’d imagine, than a new language. But I’m happy that it makes editing a multi-file I6 project a lot more pleasant than constantly doing search-scroll-and-pray editing.
The fact that the (currently terrible) name for the repo for my LS is has “ls-3” in it is a reflection that this was my third attempt to make a language server for Inform6; the first two aborted attempts were hand-parsing it (far too many special cases) and using ANTLR4 (too slow for an IDE). It’s a genuinely tricky language to parse and even accurate token classification requires a good amount of context awareness. Hence, this version just feeds the project into the real compiler (one nice thing about Inform6 is that the compiler is very fast).
Good luck with your language, and I look forward to hearing more about it, @onyxring .
Good luck with your language, and I look forward to hearing more about it,
Thanks! I really wasn’t trying to piggy back off of your announcement; sorry if it seemed that way. The overlap I was referring to is actually complementary. Beguile started as a pre-compiler for I6 and that original idea shaped it, even as it progressed into something that is clearly no longer I6. There are places where I6 can be embedded into Beguile, and the Language Server for Beguile quietly ignores those blocks. The VS Code extension defers colorization to any other I6 language handler, which is where I think two VS Code extensions leveraging our individual LSs could work together to create a wholistic picture.
Tried to install this but it does not compile as is. The instructions for Helix are wrong, VSIX extension requires Microsoft VSCode (not VSCodium), neovim didn’t even recognise the langserver. After installing the langserver for Helix it did report the files as Inform 6 but did not do anything, not even code highlighting.
Documentation comes off as very AI-generated and every file path is hardcoded to the ~/if/if-ls3 on the author’s machine.
Sorry but this is not something I’d recommend in the current form.
Oh, absolutely the instructions for Helix were AI generated. I’ve not used Helix; Claude suggested that for instructions for other editors.
You don’t get highlighting from the langserver itself; the highlighting comes from the TextMate bundle feature—if you just install the lang server, you should expect no highlighting. I’m not sure if Helix can use TextMate style bundles, but if it can, you can make a TextMate package with a command in the Makefile, and install that in Helix.
Interesting that VSCodium won’t use the extension; I don’t know what I may have done to cause that—my understanding is that it should be compatible with OpenVSX, but I’ll have to dig into that. I’ve never tried with VSCodium; on my Mac, I’ve got VSCode installed, but I do have VSCodium on a linux box, so I’ll try that there.
“~/if/if-ls3” is the path to the code on my computer, but I’m puzzled where it’s leaking out to you (the only place I can see it in the repo is the path-to-compiler in my test games, and there’s no way where I could know where your compiler would be you, and those test files are just for me). Is there somewhere else besides the stuff in test/corpus where it’s coming up for you?
Also, @Oreolek , when you say “it doesn’t compile as is”, which part are you referring to? You can’t compile the custom version of the Inform compiler? Or while trying to build the langserver itself?
I did, @fredrik . I read the message about it when I searched here. His repo link is broken, though, and it’s not in his GitHub (at least that I can see). It sounds like he’s parsing the language himself, which I found didn’t give me what I want (knowing which conditional-compilations work/don’t work, etc, which I why I wrote this using the inform compiler itself.
@Oreolek : installed Helix of my very own and fixed the config for it. To the best of my looking at their docs, it doesn’t look like they can use TextMate, even as a fallback. There is a inform6 tree sitter out there (I don’t remember the URL, but I found it with search, so it can’t be too hidden); it’s possible that that could be used with my lang server for the IDE-like-features.
The VSCodium problem is an interesting one: my package depends on the IFPlayer extension and that uses some non-VSCodium features, so it blocks installing my extension. I’ve removed that from the requirements and instead added to the README a note to install it yourself if you want “test-play-in-the-editor” features. This lets me install it on my Linux VSCodium, and it gets both highlighting and lang server stuff.
I don’t love the approach of “manually install this other extension”, so later, I’ll probably just release two separate VSIX files — one for VSCode w/the player as a dependency and one for VSCodium without.
GitHub is doing my CI now, but when its done, there should be a 0.92 release with an extension you can install in VSCodium.
(But, of course: if your “can’t compile” complaint was about installing the inform compiler here, you still won’t get any lang server features. Do let me know if you can’t build the compiler.)
@onyxring : I’ve no idea how to integrate “part of this file is I6” in textmate and LSP stuff, but I’m game to try and learn and work with you on that (assuming your stuff if license-compatible).
And no worries about any perception you’re jumping in on my announcement. I put this announcement down here in Tech Development, aiming for people who want to try out rough new software, and it’s a great thread to talk about related things on. I somehow missed your sort-of-introduction to Beguile, and am very interested to see that screencast. And very curious how you’ve wired up any kind of debugging with a game running in a VM!
I believe this occurs at the vs code level. Nested language support is handled there, and activates the appropriate language extension, which in turn communicates to its targeted Language Server. At least, that’s the way I understand it works.
Correct, I removed it from public because of some preprocessor parsing complexities that I didn’t have the stamina to fix. It worked when preprocessing was used sparingly but not that well in library files were macro directives were intermingled within statements/expressions (if I remember correctly). This seems like a better approach!
It’s been a while I have taken a look at the IF Player extension. I’m not sure what causes it not to work with VS Codium. Maybe it’s just the fact that I haven’t published it on Open-VSX. That’s something I should really take the time to do at some point.
As an aside, while I appreciate the nice words, I have to say I don’t really like being “associated” with projects coded with the help of AI/LLMs. But that’s on me I guess, my projects are open source and I haven’t expressed that I don’t want them to be used in projects built with AI/LLMs. Not that it would be enforceable anyway.
It’s fairly slow-going, but I’ve been adding debugging features for Inform6+ZMachine. I can now set breakpoints in i6, watch values, examine and set locals and globals, and jump through the call stack.
It looks like it’s just that the IF Player isn’t published on OpenVSX.
For now, I’ve kept it as “install IF Player manually if you can”, but if you ever do put IFPlayer up on OpenVSX, I’ll switch to depending on it, which will make it a lot easier for people to use.