-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Add a token store for tree sitter #237885
base: main
Are you sure you want to change the base?
Conversation
/** | ||
* The new end position of the range that got replaced. | ||
*/ | ||
readonly rangeEndPosition: Position; |
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.
Needed here, as the at the time that I was getting the position from the offset, the model could have changed and the position could be different.
vscode/src/vs/editor/common/services/treeSitter/treeSitterParserService.ts
Lines 280 to 290 in b4a24bc
private _applyEdits(model: ITextModel, changes: IModelContentChange[]) { | |
for (const change of changes) { | |
this.tree?.edit({ | |
startIndex: change.rangeOffset, | |
oldEndIndex: change.rangeOffset + change.rangeLength, | |
newEndIndex: change.rangeOffset + change.text.length, | |
startPosition: { row: change.range.startLineNumber - 1, column: change.range.startColumn - 1 }, | |
oldEndPosition: { row: change.range.endLineNumber - 1, column: change.range.endColumn - 1 }, | |
newEndPosition: { row: change.rangeEndPosition.lineNumber - 1, column: change.rangeEndPosition.column - 1 } | |
}); | |
this._newEdits = true; |
No description provided.