Skip to content

fix: avoid pathological switch matching in C and C++ - #452

Open
ownia wants to merge 1 commit into
andymass:masterfrom
ownia:fix/c_switch_statement
Open

ownia wants to merge 1 commit into
andymass:masterfrom
ownia:fix/c_switch_statement

Conversation

@ownia

@ownia ownia commented Oct 9, 2026

Copy link
Copy Markdown

Split switch scope, case, and default captures into separate query patterns to prevent long cursor-update stalls on large switches.

Background:
When I use tree-sitter + vim-matchup to edit the file https://github.com/KhronosGroup/glslang/blob/main/SPIRV/GlslangToSpv.cpp, the cursor stalls. This PR mainly focuses on fixing this issue.

Split switch scope, case, and default captures into separate query
patterns to prevent long cursor-update stalls on large switches.

Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant