-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Add some tree sitter API tests #249078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add some tree sitter API tests #249078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive API tests for the tree-sitter integration in VS Code's workbench. The tests verify core tree-sitter functionality including parsing, tree editing, progress callbacks, and change detection.
Key Changes:
- Implements test suite for tree-sitter parser API functionality
- Tests parsing with progress callbacks and tree modification behaviors
- Validates change range detection across various editing scenarios
| modifiedTreeTwo?.delete(); | ||
| }); | ||
|
|
||
| test('Test getChangedRanges 3 - ranges are not as expected because the syntax doesn\'t change', async () => { |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'doesn't' to 'doesn't' (proper apostrophe character).
|
|
||
| // Add some backticks | ||
| const offsetRanges = [new OffsetRange(153, 153), new OffsetRange(271, 271)]; | ||
| const replacements = [new StringReplacement(offsetRanges[0], 'private x =`'), new StringReplacement(offsetRanges[1], '`')]; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string 'private x =' has a missing space before the backtick which may be intentional for the test but appears inconsistent. Consider using 'private x = ' with a space before the backtick for better readability, unless the missing space is specifically required for the test case.
| const replacements = [new StringReplacement(offsetRanges[0], 'private x =`'), new StringReplacement(offsetRanges[1], '`')]; | |
| const replacements = [new StringReplacement(offsetRanges[0], 'private x = `'), new StringReplacement(offsetRanges[1], '`')]; |
No description provided.