File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11local M = {}
22
3+ --- Clear pytrize virtual text from buffer.
4+ --- @param bufnr ? integer Buffer number (0 or nil for current buffer )
35M .clear = function (bufnr )
46 local marks = require (" pytrize.marks" )
57 marks .clear (bufnr or 0 )
68end
79
10+ --- Set pytrize virtual text for parametrize entries in buffer.
11+ --- @param bufnr ? integer Buffer number (0 or nil for current buffer )
812M .set = function (bufnr )
913 local cs = require (" pytrize.call_spec" )
1014 local marks = require (" pytrize.marks" )
@@ -38,24 +42,28 @@ M.set = function(bufnr)
3842 end
3943end
4044
45+ --- Jump to the parametrize entry declaration under cursor.
4146M .jump = function ()
4247 local jump = require (" pytrize.jump" )
4348
4449 jump .to_param_declaration ()
4550end
4651
52+ --- Jump to fixture definition under cursor.
4753M .jump_fixture = function ()
4854 local jump = require (" pytrize.jump" )
4955
5056 jump .to_fixture_declaration ()
5157end
5258
59+ --- Rename fixture under cursor across the project.
5360M .rename_fixture = function ()
5461 local rename = require (" pytrize.rename" )
5562
5663 rename .rename_fixture ()
5764end
5865
66+ --- Show all usages of fixture under cursor in quickfix list.
5967M .fixture_usages = function ()
6068 local usages = require (" pytrize.usages" )
6169
Original file line number Diff line number Diff line change 11local M = {}
22
33local ts = vim .treesitter
4- local ts_query = ts .query
5- local parse_query = ts_query .parse or ts_query .parse_query
4+ local parse_query = vim .treesitter .query .parse
65
76local warn = require (" pytrize.warn" ).warn
87local tbls = require (" pytrize.tables" )
Original file line number Diff line number Diff line change 1+ local M = {}
2+
3+ M .check = function ()
4+ vim .health .start (" pytrize" )
5+
6+ -- Check Neovim version
7+ if vim .fn .has (" nvim-0.9.0" ) == 1 then
8+ vim .health .ok (" Neovim >= 0.9.0" )
9+ else
10+ vim .health .error (" Neovim >= 0.9.0 required" )
11+ end
12+
13+ -- Check Python treesitter parser
14+ local ok = pcall (vim .treesitter .language .inspect , " python" )
15+ if ok then
16+ vim .health .ok (" Python treesitter parser installed" )
17+ else
18+ vim .health .error (" Python treesitter parser not found" , {
19+ " Install with :TSInstall python (nvim-treesitter) or compile manually" ,
20+ })
21+ end
22+
23+ -- Check for grep (used by fixture rename/usages)
24+ if vim .fn .executable (" grep" ) == 1 then
25+ vim .health .ok (" grep command available" )
26+ else
27+ vim .health .warn (" grep not found — fixture rename and usages features will not work" )
28+ end
29+
30+ -- Check highlight group
31+ local settings = require (" pytrize.settings" ).settings
32+ if vim .fn .hlexists (settings .highlight ) == 1 then
33+ vim .health .ok (string.format (" Highlight group '%s' exists" , settings .highlight ))
34+ else
35+ vim .health .warn (string.format (" Highlight group '%s' not found — virtual text may be invisible" , settings .highlight ))
36+ end
37+ end
38+
39+ return M
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ local function setup_commands()
2323 end , { desc = " Show fixture usages in quickfix list" })
2424end
2525
26+ --- Configure the pytrize plugin.
27+ --- @param opts ? PytrizeSettings
2628M .setup = function (opts )
2729 opts = opts or {}
2830 settings .update (opts )
You can’t perform that action at this time.
0 commit comments