summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheprimeagain <the.primeagen@gmail.com>2026-02-04 10:30:44 -0700
committertheprimeagain <the.primeagen@gmail.com>2026-02-04 10:30:44 -0700
commit0f48c592063fcebca90b254121aaa0d10918d6be (patch)
treec01eec835048eafd65c521940d5b82d12895bbe0
parent1a0363ee23d8aff7162dc96ce2987dcb3cab42f7 (diff)
downloada4-0f48c592063fcebca90b254121aaa0d10918d6be.tar.xz
a4-0f48c592063fcebca90b254121aaa0d10918d6be.zip
removed prints and dumb comments
-rw-r--r--lua/99/editor/treesitter.lua58
-rw-r--r--scripts/tests/minimal.vim6
2 files changed, 4 insertions, 60 deletions
diff --git a/lua/99/editor/treesitter.lua b/lua/99/editor/treesitter.lua
index d5efbac..b0db2e9 100644
--- a/lua/99/editor/treesitter.lua
+++ b/lua/99/editor/treesitter.lua
@@ -22,67 +22,13 @@ local fn_call_query = "99-fn-call"
--- @param buffer number
---@param lang string
local function tree_root(buffer, lang)
- -- Load the parser and the query.
- print(
- "[treesitter] Attempting to get parser for buffer="
- .. buffer
- .. ", lang="
- .. tostring(lang)
- )
- Logger:debug("tree_root called", "buffer", buffer, "lang", lang, "id", "69")
-
local ok, parser = pcall(vim.treesitter.get_parser, buffer, lang)
if not ok then
- print("[treesitter] ERROR: Failed to get parser - " .. tostring(parser))
- Logger:debug("Failed to get parser", "error", tostring(parser), "id", "69")
- return nil
- end
-
- print("[treesitter] Parser obtained successfully, type=" .. type(parser))
- Logger:debug("Parser obtained", "parser_type", type(parser), "id", "69")
-
- local parse_ok, trees = pcall(function()
- return parser:parse()
- end)
- if not parse_ok then
- print("[treesitter] ERROR: Failed to parse - " .. tostring(trees))
- Logger:debug("Failed to parse", "error", tostring(trees), "id", "69")
- return nil
- end
-
- print(
- "[treesitter] Parse completed, trees count=" .. (trees and #trees or "nil")
- )
- Logger:debug(
- "Parse completed",
- "trees_count",
- trees and #trees or 0,
- "id",
- "69"
- )
-
- if not trees or #trees == 0 then
- print("[treesitter] ERROR: No trees returned from parse")
- Logger:debug("No trees returned", "id", "69")
- return nil
- end
-
- local tree = trees[1]
- print("[treesitter] Getting root from tree[1], tree=" .. tostring(tree))
- Logger:debug("Got tree[1]", "tree_type", type(tree), "id", "69")
-
- local root_ok, root = pcall(function()
- return tree:root()
- end)
- if not root_ok then
- print("[treesitter] ERROR: Failed to get root - " .. tostring(root))
- Logger:debug("Failed to get root", "error", tostring(root), "id", "69")
return nil
end
- print("[treesitter] Root obtained successfully, type=" .. type(root))
- Logger:debug("Root obtained", "root_type", type(root), "id", "69")
- return root
+ local tree = parser:parse()[1]
+ return tree:root()
end
--- @param context _99.RequestContext
diff --git a/scripts/tests/minimal.vim b/scripts/tests/minimal.vim
index d6dcf39..b960417 100644
--- a/scripts/tests/minimal.vim
+++ b/scripts/tests/minimal.vim
@@ -1,8 +1,4 @@
" covers all package managers i am willing to cover
-" PRIORITY: lazy.nvim paths FIRST (prepend to ensure priority)
-set rtp^=~/.local/share/nvim/lazy/nvim-treesitter
-set rtp^=~/.local/share/nvim/lazy/plenary.nvim
-" Additional paths (append)
set rtp+=.
set rtp+=../plenary.nvim
set rtp+=../nvim-treesitter
@@ -12,6 +8,8 @@ set rtp+=~/.local/share/nvim/site/pack/packer/start/plenary.nvim
set rtp+=~/.local/share/nvim/site/pack/packer/start/nvim-treesitter
set rtp+=~/.local/share/lunarvim/site/pack/packer/start/plenary.nvim
set rtp+=~/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter
+set rtp^=~/.local/share/nvim/lazy/nvim-treesitter
+set rtp^=~/.local/share/nvim/lazy/plenary.nvim
set autoindent
set tabstop=4