vimPlugins.kulala-nvim: init at 2024-09-30#332758
Conversation
|
This plugin depends on curl, it is probably a good idea to patch it like here: nixpkgs/pkgs/applications/editors/vim/plugins/overrides.nix Lines 316 to 323 in a4638fa Lines, where curl is used: https://github.com/mistweaverco/kulala.nvim/blob/7649576ca459146658b4c415d1a320bbedc3f564/lua/kulala/graphql/init.lua#L21 https://github.com/mistweaverco/kulala.nvim/blob/7649576ca459146658b4c415d1a320bbedc3f564/lua/kulala/parser/init.lua#L448 |
2e23e2b to
a4fdfd6
Compare
jlesquembre
left a comment
There was a problem hiding this comment.
You forgot to update https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names.
Other than that, LGTM.
557a3e8 to
2087fcb
Compare
PerchunPak
left a comment
There was a problem hiding this comment.
Don't know why, but it fails to run with this error:
Failed to run `config` for kulala.nvim
...d-0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 1:2. Invalid node type "section":
(section (request) @request) @section
^
# stacktrace:
- /nix/store/g2a2ipz91mj1pqqca063idj21sg47wbd-neovim-unwrapped-0.10.1/share/nvim/runtime/lua/vim/treesitter/query.lua:252 _in_ **fn**
- /nix/store/g2a2ipz91mj1pqqca063idj21sg47wbd-neovim-unwrapped-0.10.1/share/nvim/runtime/lua/vim/func/_memoize.lua:58 _in_ **parse**
- /nix/store/z98vs4iz6hixp4dg4zmxv5ajzvavzcac-vim-pack-dir/pack/myNeovimPackages/start/kulala.nvim/lua/kulala/parser/treesitter.lua:12
- /nix/store/z98vs4iz6hixp4dg4zmxv5ajzvavzcac-vim-pack-dir/pack/myNeovimPackages/start/kulala.nvim/lua/kulala/parser/init.lua:11
- /nix/store/z98vs4iz6hixp4dg4zmxv5ajzvavzcac-vim-pack-dir/pack/myNeovimPackages/start/kulala.nvim/lua/kulala/ui/init.lua:6
- /nix/store/z98vs4iz6hixp4dg4zmxv5ajzvavzcac-vim-pack-dir/pack/myNeovimPackages/start/kulala.nvim/lua/kulala/init.lua:1
- /nix/store/skk4qac1ds1957i9dpq2zcin80bcnra4-nixCats-special-rtp-entry-LuaConfig/lua/nixCatsUtils/lazyCat.lua:135 _in_ **setup**
- /nix/store/skk4qac1ds1957i9dpq2zcin80bcnra4-nixCats-special-rtp-entry-LuaConfig/lua/lazy-plugins.lua:3
- /nix/store/skk4qac1ds1957i9dpq2zcin80bcnra4-nixCats-special-rtp-entry-LuaConfig/init.lua:51
- /nix/store/xysvz9j297w2m754hljznh9ynhxpvhn1-init.lua:19
Also, this plugin now depends on treesitter HTTP grammar as well: https://kulala.mwco.app/docs/getting-started/requirements/#syntax-highlighting (crashes without it)
|
But, there's no way to add treesitter-http into plugin dependency. At least, I don't know how to. |
|
There is: kulala-nvim = super.kulala-nvim.overrideAttrs {
dependencies = with self; [ (nvim-treesitter.withPlugins (p: [ p.http ])) ];
}; |
|
Not sure if this is the best approach, but nixpkgs/pkgs/applications/editors/vim/plugins/overrides.nix Lines 899 to 904 in fab8ea9 |
|
Yeah, it looks like a legacy approach. I think, better to use |
kulala-nvim = super.kulala-nvim.overrideAttrs {
dependencies = with self; [ (nvim-treesitter.withPlugins (p: [ p.http ])) ];
};The problem with that approach is that it seems to override the user configuration. For me, I have I personally would merge the PR as it is. |
I think the http treesitter in nixpkgs is old or kulala-nvim has problem. And adding treesitter into plugin dependencies is not a good solution. I will switch to hurl-nvim temporarily and update this plugin as well. |
Looks like a kulala problem. Though the plugin is in active development and enough time passed, I think if you update the PR everything will be fixed
Specifing |
|
The error is due to mistweaverco/kulala.nvim#213, the treesitter-http in nixpkgs is old, waiting for #337299. I think everyone using Treesitter has installed it individually. Maybe, we can make a treesitter deps config to make sure the parser adding to vimPlugins.nvim-treesitter.withPlugins. And then, those parser will combine to one dir successfully. kulala-nvim = super.kulala-nvim.overrideAttrs {
buildInputs = [ curl ];
treesitterDependencies = (p: with p; [ http ]);
postPatch = ''
substituteInPlace lua/kulala/graphql/init.lua \
--replace '"curl"' '"${lib.getExe curl}"'
substituteInPlace lua/kulala/parser/init.lua \
--replace '"curl"' '"${lib.getExe curl}"'
'';
}; |
|
|
|
Treesitter should load just on demand for now (if you're enabled treesitter= true via opts, otherwise it won't load at all and default to the internal parser). So the problem should be fixed. |
|
Well, it crashed for me when I didn't have HTTP grammar installed |
Will check, shouldn't crash, because it should be completely optional at the current state. |
|
Have checked with the latest commit on main, ts http grammar not installed. Won't crash, just works. 🤷🏾 |
|
You need to change the replacement of curl when using the latest version. It's configurable via opts now. |
|
Ok, I will do it later. |
|
Now, treesitter-http is optional, so there's no need to add it to the dependencies. |
PerchunPak
left a comment
There was a problem hiding this comment.
Verified that it works without treesitter
|
Result of 2 packages built:
|
|
We're planning on having treesitter-http-grammar as a dependecy soon, but won't break if it's not available. We will just notify the user via a message, that Kulala won't work without the grammar. Is this something you guys and girls can live with, or do we (or you) need to update the pkg then? See this discussion for further information: mistweaverco/kulala.nvim#225 |
|
I add treesitter to dependencies. But I think is not the best way to solve treesitter dependencies. I have no plan about adding initLua passthru. |
PerchunPak
left a comment
There was a problem hiding this comment.
We're planning on having treesitter-http-grammar as a dependecy soon
I still feel this plugin moves too fast for nixpkgs :)
There was a problem hiding this comment.
As stated in #332758 (comment), it overwrites user configuration. Better would be to do:
| dependencies = with self; [ (nvim-treesitter.withPlugins (p: [ p.http ])) ]; | |
| dependencies = with self; [ | |
| nvim-treesitter | |
| nvim-treesitter-parsers.http | |
| ]; |
There was a problem hiding this comment.
What is the right way? I don't known.
If it overwrites user configuration, those plugins are all broken.
|
What's the status here? Can I help you guys and girls with something to get this merged? |
|
After a discussion in Matrix, we decided that the best way is to add dependencies only to PATH in wrapper (maybe will be implemented in #344541). For now, @CnTeng, please implement solution I provided in that review above. Unfortunately, because of the life situation, I don't really have time and cannot test right now if those plugins are broken. |
Description of changes
https://github.com/mistweaverco/kulala.nvim
close #325970
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.