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

Further reduce allocations in semantic tokens #9285

Merged
merged 12 commits into from
Sep 14, 2023

Conversation

davidwengier
Copy link
Contributor

@davidwengier davidwengier commented Sep 14, 2023

Follow up to #9280

This creates a struct based API for document mapping, and moves semantic tokens to it. I did it in a source-compatible way so we can upgrade existing features as necessary. I suspect most won't get the benefit that semantic tokens gets, as most things just ferry ranges and positions around, and don't process them much. Logged #9284 to follow up though.

Commit-at-a-time might be easiest.

Results for semantic tokens are pretty good though:
image

Doing Range and Position for now. TextEdit might be worth it later
I expect some calls won't make sense to update so these might stay around, or maybe they'll just be temporary. Who knows!
This also includes some consolidation, so SourceTextExtensions is the only thing that does the work, so everything is LSP compliant
With the help of a few new helper methods
@ToddGrun
Copy link
Contributor

This looks really good to me. I'm going to defer to someone on the razor team for actual signoff though.

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

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

Great change! Well done!

@davidwengier davidwengier merged commit c3b3fab into dotnet:main Sep 14, 2023
@ghost ghost added this to the Next milestone Sep 14, 2023
@davidwengier davidwengier deleted the DocumentMappingWithStructs branch September 14, 2023 22:02
@Cosifne Cosifne modified the milestones: Next, 17.8 P3 Sep 25, 2023
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.

5 participants