Language Module Redesign (feedback requested) #748
Replies: 5 comments 7 replies
-
|
It's been bugging me for a while that we can only choose one formatter at a time, some projects use prettier and some use biome. Maybe we could allow for multiple formatter and activate them if the configuration file is present in the root directory? |
Beta Was this translation helpful? Give feedback.
-
|
To me, one fo the most attractive parts of nvf (and one that also impresses those that I show my nvf config) is the ability to enable full language support, including parsing, debugging, linting and lsp, with a single That said, I definitely see the benefits in moving language configuration out of the individual language options. The language framework is pretty rigid, and the nvim-lint and conform modules definitely allow for more freedom for end users, as well as more consistency. So while I think the direction is positive, I hope there'll still be room for some automagic language configuration. As an end user, I also find it intuitive to have language-specific tooling under their related language, though this is partly because I started using Nix before Neovim, and so have never written a full Neovim configuration in lua. Perhaps options under each language that proxy to e.g. |
Beta Was this translation helpful? Give feedback.
-
|
Hello and thank you for your work, My main gripe, more molehill than mountain, with nvf is the lack of repl support and missing some languages I'd like to learn (namely, a Lisp like Janet or something). I'm working to add My question is so: in light of this discussion, how should one add support for another |
Beta Was this translation helpful? Give feedback.
-
|
Hi all, #860 has been isolated as a separate patch and merged into main. With above needs in mind, I would appreciate your feedback if you get a chance to test it out. |
Beta Was this translation helpful? Give feedback.
-
|
Since languages like JS/TS, Astro, Svelte etc often shares the same linter and formatter (eg: eslint, prettier, ...), we could have linters and formatters be their own separate modules (eg: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Good day nvf users, as most of you are aware the language module refactor has been on our to-do list for a while now. It has been postponed due to several internal changes that managed to take priority, but now it is back as our main priority. Especially with several language incoming additions.
The Problem
A lot of technical debt has accumulated around the language module. Some of the changes made has sacrificed on the customizability of the module, and as new language modules are requested/contributed the debt only grows larger. Before this becomes fully unmanagable, I would like to refactor the language modules in full.
The Solution
The module options set internally, and obscurely, by
vim.languages.*must be moved to an user-facing interface. nvim-lint and conform have already made their ways intovim.diagnosticsandvim.formatterso that is a good step over null-ls, which did not expose anything other than a configuration option to dump strings into. Additionally, we're in the process of exposing language server options aslsp.optionswith #643, and that'll allow a larger degree of customizability.Yet, one problem remains in PRs such as #575; some languages require using multiple LSPs (hint python hint) and others barely have a single functional LSP. Allowing multiple LSPs in one module but not in another opens the door to a large inconsistency. To help counter this, I am proposing
vim.lspas an option that offers full control over LSP setups directly outside the language module, which should allow configuring LSPs, diagnostics and formatters separately as a partial remedy to #747.Discussion
I would like your feedback on the matter. Feel free to leave any questions, comments, suggestions, proposals, etc. below this post and we'll discuss them in detail. nvf is shaped mainly by feedback and as such your feedback is important to us.
Beta Was this translation helpful? Give feedback.
All reactions