File tree Expand file tree Collapse file tree 2 files changed +37
-35
lines changed
tests/test-sources/plugins/languages/treesitter Expand file tree Collapse file tree 2 files changed +37
-35
lines changed Original file line number Diff line number Diff line change 1+ { pkgs , ... } :
2+ {
3+ combine-plugins = {
4+ performance . combinePlugins . enable = true ;
5+
6+ plugins . treesitter = {
7+ enable = true ;
8+
9+ # Exclude nixvim injections for test to pass
10+ nixvimInjections = false ;
11+ } ;
12+
13+ extraConfigLuaPost = ''
14+ -- Ensure that queries from nvim-treesitter are first in rtp
15+ local queries_path = "${ pkgs . vimPlugins . nvim-treesitter } /queries"
16+ for name, type in vim.fs.dir(queries_path, {depth = 10}) do
17+ if type == "file" then
18+ -- Resolve all symlinks and compare nvim-treesitter's path with
19+ -- whatever we've got from runtime
20+ local nvim_treesitter_path = assert(vim.uv.fs_realpath(vim.fs.joinpath(queries_path, name)))
21+ local rtp_path = assert(
22+ vim.uv.fs_realpath(vim.api.nvim_get_runtime_file("queries/" .. name, false)[1]),
23+ name .. " not found in runtime"
24+ )
25+ assert(
26+ nvim_treesitter_path == rtp_path,
27+ string.format(
28+ "%s from rtp (%s) is not the same as from nvim-treesitter (%s)",
29+ name,
30+ rtp_path, nvim_treesitter_path
31+ )
32+ )
33+ end
34+ end
35+ '' ;
36+ } ;
37+ }
Original file line number Diff line number Diff line change 120120 ] ;
121121 } ;
122122 } ;
123-
124- combine-plugins = {
125- performance . combinePlugins . enable = true ;
126-
127- plugins . treesitter = {
128- enable = true ;
129-
130- # Exclude nixvim injections for test to pass
131- nixvimInjections = false ;
132- } ;
133-
134- extraConfigLuaPost = ''
135- -- Ensure that queries from nvim-treesitter are first in rtp
136- local queries_path = "${ pkgs . vimPlugins . nvim-treesitter } /queries"
137- for name, type in vim.fs.dir(queries_path, {depth = 10}) do
138- if type == "file" then
139- -- Resolve all symlinks and compare nvim-treesitter's path with
140- -- whatever we've got from runtime
141- local nvim_treesitter_path = assert(vim.uv.fs_realpath(vim.fs.joinpath(queries_path, name)))
142- local rtp_path = assert(
143- vim.uv.fs_realpath(vim.api.nvim_get_runtime_file("queries/" .. name, false)[1]),
144- name .. " not found in runtime"
145- )
146- assert(
147- nvim_treesitter_path == rtp_path,
148- string.format(
149- "%s from rtp (%s) is not the same as from nvim-treesitter (%s)",
150- name,
151- rtp_path, nvim_treesitter_path
152- )
153- )
154- end
155- end
156- '' ;
157- } ;
158123}
You can’t perform that action at this time.
0 commit comments