[go: up one dir, main page]

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

Improve unusable slowness of tree sitter syntax highlighting #229952

Closed
wants to merge 3 commits into from

Conversation

alexr00
Copy link
Member
@alexr00 alexr00 commented Sep 27, 2024

Part of #229935

@alexr00 alexr00 self-assigned this Sep 27, 2024
let lastScopeIndex = scope.length - 1;
let lastIdentifierIndex = findInIdents(scope[lastScopeIndex--], identifers.length);
if (lastIdentifierIndex >= 0) {
const score = (lastIdentifierIndex + 1) * 0x10000 + identifers[lastIdentifierIndex].length;
while (lastScopeIndex >= 0) {
while (lastScopeIndex >= minimumLastScopeIndex) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aeschli, I am not 100% certain of this change. On line 828 there is if (scope.length < identifers.length) { which seems to indicate that it's ok for the scope array to be longer than the identifiers array. However, without my change, the condition on 838 is hit and -1 is returned if the scope array is longer than identifiers.

@alexr00 alexr00 closed this Sep 30, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant