Skip to content
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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

Conversation

alexr00
Copy link
Member

@alexr00 alexr00 commented Jan 14, 2025

No description provided.

@alexr00 alexr00 self-assigned this Jan 14, 2025
@alexr00 alexr00 marked this pull request as ready for review January 16, 2025 11:12
@alexr00 alexr00 enabled auto-merge (squash) January 16, 2025 11:12
@alexr00 alexr00 requested a review from alexdima January 16, 2025 11:12
@vs-code-engineering vs-code-engineering bot added this to the January 2025 milestone Jan 16, 2025
/**
* The new end position of the range that got replaced.
*/
readonly rangeEndPosition: Position;
Copy link
Member Author

@alexr00 alexr00 Jan 16, 2025

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.

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;

@alexr00 alexr00 disabled auto-merge January 17, 2025 10:00
@alexr00 alexr00 marked this pull request as draft January 17, 2025 15:44
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