Open TungstnBallon opened 7 months ago
This sounds like a really nice extension, even though most of it is in projects we have no control over (e.g. vim)? From what I see, for us this would mean:
most of it is in projects we have no control over (e.g. vim)?
Yes, but in case of vim and nvim-lspconfig a plugin can accomplish the same without a noticeable difference. So we are not dependent on our changes getting merged there.
Langium generates TextMate and Monarch grammars, would any of these work?
I found this plugin. It looks into the VSCode extension directory and uses the textmate grammars there to highlight the file in neovim. This means that both VSCode and our extension for it need to be installed in order for syntax highlighting in neovim to work. It's a little janky but it does work.
I think we'd have an okay time setting up a buildstep that exports textmate grammars and the lsp executable on their own. That would free these files up from the VSCode extension. I think that would be a step that would make integration into neovim more elegant, right?
The problem is that nvim-textmate doesn't support loading the grammar from a specific file. It only supports VSCode extensions. It may be possible to create a hacky solution where vscode doesn't have to be installed, but I can't say how much effort that would be.
User Story
User Acceptance Criteria
Notes
All languages with good neovim support share these features:
File recognition All this requires is getting the
.jv
extension added to this file (example pr).Language server This is also easily accomplished by adding the jayvee language server to mason-registry (auto-install) and nvim-lspconfig (auto-configure). Until now, I've extracted the language server executable from the vscode extension. This is tedious though and it also makes automatic installation hard. I propse that we publish the lsp executable as a separate package.
Syntax highlighting? Most big languages have a treesitter grammar which, among other things, provides syntax highlighting. However, I did not find a way to convert a langium grammar to a treesitter grammar and writing one from scratch seems very difficult. This will probably have to wait.
While the PRs necessary for 1. and 2. are waiting to be merged, they can be replicated with a plugin.
Definitions of Done