-
nixvim provides a helper
read more here - https://nix-community.github.io/nixvim/user-guide/install.html#standalone-usage does nvf offer something like that? use case: I can use |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
No, we do not yet offer way of providing headless tests for your configuration. Though for a while now, I have been looking at ways this can be done. Machine tests are obviously a good start, and I took a few jabs in the past but the possible implementations were not very satisfying to say the least. I also want to lint resulting Lua config (since we can predict its path), but that will have to wait until LSPs are finished. Do note, I'm not familiar with NixVim and I'd rather keep it that way if you don't mind. Though if you have a good idea, I would appreciate a design proposal on how tests may be implemented. From what I can see you are already familiarized with nvf's codebase, so I trust that you might be able to come up with something before I can. Also see #285 for the first initial draft that went nowhere. |
Beta Was this translation helpful? Give feedback.
-
+1
Absolutely not! having used both, I like nvf better(may be I am opinionated, but it is what I feel). nvf follows the mental model of lazy loading by default and several other advantages which convinced me to use nvf in first place :)
Taking a look, but if I were to implement this, I would also probably do machine checks like how nixos / nixos-generators do it - that is spin up a lean vm, spawn nvim that the wrapper built and check |
Beta Was this translation helpful? Give feedback.
-
Sorry for the churn, I also tried the injected formatter from conform for lua multi line strings in nix - https://github.com/stevearc/conform.nvim/blob/master/doc/advanced_topics.md#injected-language-formatting-code-blocks, however, it is super buggy since it also validates AST in lua code(at least stylua does) and so I just decided to use a temp file approa ch to format my inline lua code |
Beta Was this translation helpful? Give feedback.
-
I've submitted a PR to mnw in order to allow for arbitrary check hooks, which should allow for performing extensive tests within the context of your Neovim configuration during the build process. Though for Looking at Nixvim's implementation (which is unreadable how do people read all that?), they have a wrapper around the module system so we could implement something similar, but that would only work for standalone builds, which should be easy enough to extend from the user's side without any additional functions, but we can flesh out the API inside the existing builder.
Lastly I've started looking at machine tests again. This is what I had in mind, and with the current implementation it's mostly working but there can be more edge cases that we can check by default. It's also going to be very slow to check for all plugins if we choose to add tests for all of them.
For in-line Lua strings parsed via mkLuaInline? Or just multi-line strings in general? Treesitter might be a better choice for something like this, we've been looking at injections for syntax highlighting and it might be possible to also add some formatting options using TS the same way. Although I am not entirely sure, TS ecosystem is still a little foreign to me. |
Beta Was this translation helpful? Give feedback.
No, we do not yet offer way of providing headless tests for your configuration. Though for a while now, I have been looking at ways this can be done. Machine tests are obviously a good start, and I took a few jabs in the past but the possible implementations were not very satisfying to say the least. I also want to lint resulting Lua config (since we can predict its path), but that will have to wait until LSPs are finished.
Do note, I'm not familiar with NixVim and I'd rather keep it that way if you don't mind. Though if you have a good idea, I would appreciate a design proposal on how tests may be implemented. From what I can see you are already familiarized with nvf's codebase, so I tru…