Language server for editing `.editorconfig` file?
It's great if we have a language server for .editorconfig file. 🤔
Similar projects:
- https://github.com/madskristensen/EditorConfigLanguage
- https://github.com/Lilja/ecls
Are you talking about some kind of web-editor to create and edit the .editorconfig files ?
I think it would be great to have this. Mostly I would hope to have a feature that you can provide an example directory structure and you see which .edidorconfig ruls match to the certain files.
e.g. you hover a file and see
- The editorconfigs and lines of all rules that effect this file
- see in result what rulesset is used on this file
Currently I often struggle with situation where an rule SHOULD be applid to any file, but for some reason it does not take effect, anything is incorrect with your patterns and file masks
I mean the Language Server Protocol, so we edit the file on any editors that support LSP, e.g., Emacs, Vim, VSCode, Sublime, etc.
While there is no language server for editorconfig, in Vim and Neovim (with treesitter disabled), you can press Ctrl-x Ctrl-o to get completion for properties
This doesn't seem hard to implement. The question is in what language it should be written
I've written two language servers in C# and Emacs Lisp in the past.
- https://github.com/shader-ls/shader-language-server (in C# for ShaderLab)
- https://github.com/elisp-lsp/ellsp (in Emacs Lisp for Emacs Lisp)
Other popular options are TypeScript (Node), C (the core), or Rust, etc. 🤔
The question is in what language it should be written
I would vote for a compiled language that can be cross-compiled, like Go, Rust. Or even Zig if you are ok with chasing its development :))
compiled language that can be cross-compiled
that's something I agree with.
@xuhdev @cxw42 could you share your thoughts? The VSCode plugin already provides autocompletion, and perhaps some others do too, but it would be nice to have one LSP that every plugin could use. This is also quite low-hanging fruit.
@SunsetTechuila Absolutely! Having one LSP server is better than lingering on considering which language to use :)
No strong preferences.
Looking at the top post, I see the two given are C# and TS, respectively. The C# one appears to be more active, but also fairly tightly bound to VSCode.
I think Python or TS are worth considering. From some quick searching, I see:
- Python: a framework at https://github.com/openlawlibrary/pygls
- TS: an example at https://github.com/semanticart/minimum-viable-vscode-language-server-extension
Maybe ask @Lilja whether we could adopt the existing TS https://github.com/Lilja/ecls ?
(That said, if somebody on this issue wants to write a new language server right now, I won't stop you 😁 )
Hey all, thanks for tagging me. I'm the author of "ecls" which I wrote a couple of years ago as a project to learn about the Language Server Protocol.
Feel absolutely free to fork or copy code from that repository. I don't remember how well the code quality is, your mileage may vary.
My learnings from writing a LS:
- The library that microsoft has written, vscode-languageserver was quite nice to use from a developer experience point of view. As you don't need to write your typings. I think most LS written in typescripts use this framework.
- I wrote a bunch of features, like validating the yaml, providing some intellisense/suggestions, a basic hover. But after a while I sort of gave up as I didn't really see the usefulness in it. I tried to upstream my LS implementation to the neovim lsp-config repositry and got yelled at by the maintainers. So I didn't feel like continuing working on it 😅
- My implementation only uses the editorconfig you have opened. But I suppose that you also want to supported nested ones, which in theory could be several. There is likely complexity in trying to perform validation on nested structure.
Thanks for the response and for the extra context @Lilja !