jonnyboyC / kos-language-server

A language server for the Kerboscript (kOS) a language for Kerbal Space Program
MIT License
25 stars 6 forks source link

[Feature] Region folding support #77

Closed jefferyharrell closed 5 years ago

jefferyharrell commented 5 years ago

If I'm not mistaken, VS Code now supports region folding, but it has to be implemented per language extension. It'd be great if the kOS language mode supported a syntax something like

//#region somename

// arbitrary amount of code

//#endregion

I have no idea how to develop for VS Code so I can't offer any implementation suggestions, but here's a link that might be a place to start.

Thanks!

jonnyboyC commented 5 years ago

Thanks for the feature request! I think this would definitely be doable, any preference in terms of what the folding region be called. I'm perfectly fine with #region / #endregion as tags or anything else. I may ask on the kOS discord if anyone else has a preference as well.

jefferyharrell commented 5 years ago

Thanks for the extension! I've really been relying heavily on it, as I've been working on a kOS project for fun in my spare time.

As for the syntax, I think "//#region" and "//#endregion" would be good choices because they're the same as VS Code's built-in JavaScript region folding syntax. But by all means, ask around. I don't have a strong opinion. I've just got a monster kOS file and I'd like to scroll less. ;-)

jonnyboyC commented 5 years ago

Just released version 0.8.0 With the new folding region. No one in particularly had a preference so this will work now

// #region 
print("foldable").
// #endregion