Skip to content

Commit f24d4c7

Browse files
committed
Simplified fix - minimal changes (Sun Nov 30 20:59:04 PST 2025)
1 parent 0e81ee4 commit f24d4c7

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,54 @@ jobs:
4242
- name: Check for errant util calls
4343
run: make no-utils
4444

45+
- name: Inspect Parser Environment (Pre-Test)
46+
run: |
47+
echo "=== Neovim Version ==="
48+
nvim --version | head -3
49+
echo ""
50+
echo "=== System Info ==="
51+
uname -a
52+
gcc --version | head -1
53+
echo ""
54+
echo "=== nvim-treesitter Git Info ==="
55+
cd $HOME/.local/share/nvim/lazy/nvim-treesitter
56+
git log --oneline -1
57+
git describe --tags --always
58+
echo ""
59+
echo "=== Parser Directory State (Before Tests) ==="
60+
ls -lah $HOME/.local/share/nvim/lazy/nvim-treesitter/parser/ 2>&1 || echo "Parser directory does not exist yet"
61+
4562
- name: Run Tests
4663
run: make test
4764

65+
- name: Inspect Parser Binaries (Post-Test)
66+
if: always()
67+
run: |
68+
echo "=== Parser Directory State (After Tests) ==="
69+
ls -lah $HOME/.local/share/nvim/lazy/nvim-treesitter/parser/
70+
echo ""
71+
echo "=== Parser Binary Checksums ==="
72+
cd $HOME/.local/share/nvim/lazy/nvim-treesitter/parser/
73+
for parser in *.so; do
74+
echo "File: $parser"
75+
ls -lh "$parser"
76+
md5sum "$parser"
77+
file "$parser"
78+
echo ""
79+
done
80+
echo ""
81+
echo "=== Dump TypeScript Test Tree Structure ==="
82+
cd $GITHUB_WORKSPACE
83+
nvim --headless -u tests/minimal_init.lua \
84+
-c "edit tests/fixtures/typescript.ts" \
85+
-c "lua vim.fn.cursor(121, 3)" \
86+
-c "lua local node = vim.treesitter.get_node(); print('Current node at 121,3:'); print(' Type: ' .. node:type()); print(' Range: ' .. node:range()); local parent = node:parent(); if parent then print('Parent node:'); print(' Type: ' .. parent:type()); print(' Range: ' .. parent:range()) end" \
87+
-c "qa!" 2>&1 || echo "Tree dump failed"
88+
echo ""
89+
echo "=== Dump Java Test Tree Structure ==="
90+
nvim --headless -u tests/minimal_init.lua \
91+
-c "edit tests/fixtures/java.java" \
92+
-c "lua vim.fn.cursor(31, 1)" \
93+
-c "lua local node = vim.treesitter.get_node(); print('Current node at 31,1:'); print(' Type: ' .. node:type()); print(' Range: ' .. node:range()); local parent = node:parent(); if parent then print('Parent node:'); print(' Type: ' .. parent:type()); print(' Range: ' .. parent:range()) end" \
94+
-c "qa!" 2>&1 || echo "Tree dump failed"
95+

lua/treewalker/targets.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@ function M.out(node)
1616
-- node below the comment
1717
-- Note: For some reason, this isn't required locally (macos _or_ Makefile ubuntu,
1818
-- but does fail on CI. TODO figure out the differences)
19-
-- On CI, comment nodes behave differently - work from parent instead
2019
if nodes.is_comment_node(node) or nodes.is_augment_target(node) then
21-
local parent = node:parent()
22-
if parent then
23-
node = parent
24-
end
20+
node = M.down(node, nodes.get_srow(node)) or node
2521
end
2622

2723
local candidate = strategies.get_first_ancestor_with_diff_scol(node)

0 commit comments

Comments
 (0)