Inform 6 extension for VS Code

I was wondering about this, as well. I actually use Textpad, but the same principle applies with @Natrium729’s VSCode extension. Would it be feasible to use a different file name extension (such as pun) for PunyInform games and leave the inf extension for Inform 6 and Glulx games?

well, I think that this remnant of the mess of gate$, the 3-letter extension ought to disappear OFA, so if one really want an extension for puny, ought to use a .4 extension, like .pinf

(I actually differentiate by directory, here being a …/wrk/inf6/puny directory, I consider this a good usage)

Best regards from Italy,
dott. Piergiorgio.

The Inform 6 system really is a language and library, and PunyInform only replaces the library. Just like for all just about all other programming languages, the language decides the file extension, not the library. And then there are library files and extensions which end with “.h”, which makes most text editors go into C mode.

Also note that the compiler isn’t neutral in this, as it will append “.inf” automatically if you don’t provide a file extension (".h" for regular includes).

Could the extension have different modes that you could switch between with a keypress and/or menu option? If you’re using the standard library mode while editing a PunyInform file, it won’t really be a disaster - almost all of it is the same. When you notice it’s the wrong mode you can press a key a change it. And you could choose the default mode to use, so for those who almost exclusively use one or the other, it will almost always be correct from the start.

2 Likes

It should be possible in VS Code, yes. As you mentioned, .h is also used for C, so VS Code gives you the choice between C and Inform and you can set the default to use. It should be possible to make it so there is a “Inform 6 - PunyInform” and even a “Inform 6 - no library” in the following menu:

image

But I’m still pondering if it’s a good idea, as I explained above. It makes more work for me to keep the extension up to date, but not much either. And people can still make merge request when a new version of Puny or other library is released.

And since there’s demand for that, I guess I’ll try, at least.

2 Likes