Problem
The current doDefinition implementation uses text.indexOf() to find the matching closing tag. This is unreliable in complex XML files where identical tag names appear multiple times, as it may jump to the wrong tag. It is also less efficient than using the existing AST.
Proposed Solution
Refactor the logic to rely on the XMLNode structure rather than manual string searching.
Key Improvements:
- Direct Offset Mapping: Use node.endTagStartOffset (if available in parser) to jump directly to the closing tag.
- Eliminate indexOf: Remove text-based searching to prevent "false positive" matches.
- Support Self-Closing Logic: Explicitly handle or skip nodes that don't have a closing pair more gracefully.
Labels
enhancement, Definition, Navigation
Problem
The current doDefinition implementation uses text.indexOf() to find the matching closing tag. This is unreliable in complex XML files where identical tag names appear multiple times, as it may jump to the wrong tag. It is also less efficient than using the existing AST.
Proposed Solution
Refactor the logic to rely on the XMLNode structure rather than manual string searching.
Key Improvements:
Labels
enhancement, Definition, Navigation