Skip to content

Use frozen-partial semantics when producing semantic classifications#51704

Merged
4 commits merged intodotnet:mainfrom
CyrusNajmabadi:frozenClassification
Mar 8, 2021
Merged

Use frozen-partial semantics when producing semantic classifications#51704
4 commits merged intodotnet:mainfrom
CyrusNajmabadi:frozenClassification

Conversation

@CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Mar 5, 2021

Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1284416

Normal semantics may take a very long time to compute for a document. Particularly during project load, or in multi-lang cases (due to building skeleton assemblies). This waiting does not help, and actively hinders the classification experience as it means that we have to wait for all bg compilation work to finish for that project before getting semantic classifications.

With frozen partial semantics though, we snap the state of hte project wherever we are in BG compilation (i.e. however far along we are with parsing files and loading metadata). This allows us to at least classify what we understand so far, allowing more accurate classifications to be returned gradually as we understand more of the project.

For a multi-lang case, we'd be able to get classifications for all types parsed in that lang, and all normal metadata refs. Only things like symbols from skeletons would take a little bit longer.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 5, 2021 19:09
@ghost ghost added the Area-IDE label Mar 5, 2021
@jasonmalinowski
Copy link
Member

@CyrusNajmabadi The optimization seems wise, but once we do have a proper compilation, do we refresh? or is this going to result in classifications being "stuck" and never completed until an edit or something else that forces a recompute?

(now I say this as somebody who thinks they noticed a stuck classification yesterday so this may not be making problems worse, or it's not enough of a bug to matter...)

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Approved, with the caveat that I wonder if this is introducing a bug. But that might not matter.

@CyrusNajmabadi
Copy link
Contributor Author

THe major question would be: will this result in a notification that the workspace had changed. It may not, which is indeed a potential problem. Will take offline to dsicuss with you.

Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Looks solid to me.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@ghost ghost merged commit dc800a1 into dotnet:main Mar 8, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the frozenClassification branch March 8, 2021 22:38
@allisonchou allisonchou added this to the Next milestone Mar 12, 2021
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants