diff options
| author | Lewis Russell <lewis6991@gmail.com> | 2026-09-24 13:30:07 +0100 |
|---|---|---|
| committer | Lewis Russell <me@lewisr.dev> | 2026-09-25 10:28:19 +0100 |
| commit | d7af8707026968887ea4ee3a4e6fa51fd4372033 (patch) | |
| tree | 19cae6c571311bbd5af56575dcc710485568f7b8 /runtime/lua/vim/treesitter/dev.lua | |
| parent | f6aac851ddd82db5241a56ddfb9cc9a9aec8f7e5 (diff) | |
| download | rneovim-d7af8707026968887ea4ee3a4e6fa51fd4372033.tar.gz rneovim-d7af8707026968887ea4ee3a4e6fa51fd4372033.tar.bz2 rneovim-d7af8707026968887ea4ee3a4e6fa51fd4372033.zip | |
fix(lua): enable nil-safety diagnostics in runtime code
Enable EmmyLua's need-check-nil diagnostic and resolve nullable values
through more precise types, explicit invariants, and guards for missing
runtime state. Keep analyzer-specific workarounds local and update the
affected API documentation.
Exclude the bundled re.lua from analysis so its nil-check warnings do
not fail CI.
AI-assisted
Diffstat (limited to 'runtime/lua/vim/treesitter/dev.lua')
| -rw-r--r-- | runtime/lua/vim/treesitter/dev.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua index 228d434cdc..c719e0dbd2 100644 --- a/runtime/lua/vim/treesitter/dev.lua +++ b/runtime/lua/vim/treesitter/dev.lua @@ -410,7 +410,7 @@ function M.inspect_tree(opts) nowait = true, callback = function() local row = api.nvim_win_get_cursor(w)[1] - local lnum, col = treeview:get(row).node:start() + local lnum, col = assert(treeview:get(row)).node:start() -- update source window if original was closed if not api.nvim_win_is_valid(win) then @@ -481,7 +481,7 @@ function M.inspect_tree(opts) w = api.nvim_get_current_win() api.nvim_buf_clear_namespace(buf, treeview.ns, 0, -1) local row = api.nvim_win_get_cursor(w)[1] - local lnum, col, end_lnum, end_col = treeview:get(row).node:range() + local lnum, col, end_lnum, end_col = assert(treeview:get(row)).node:range() api.nvim_buf_set_extmark(buf, treeview.ns, lnum, col, { end_row = end_lnum, end_col = math.max(0, end_col), |