-
Notifications
You must be signed in to change notification settings - Fork 199
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
Replace ISolutionQueryOperations in hover with a dedicated service #11374
Replace ISolutionQueryOperations in hover with a dedicated service #11374
Conversation
When determining what projects a component or tag helper is available within, there is slightly different behavior in the Razor language server vs. co-hosting. In the language server, there is a special case to skip the misc files project which isn't bothered with in co-hosting. The special case is manifested via the different implementations of ISolutionQueryOperations.GetProjectsContainingDocument. This change introduces a new service, IComponentAvailabilityService, that is used to determine what projects a component or tag helper is available within. The intention is that this service contains the behavior difference between the language server and co-hosting rather than relying on ISolutionQueryOperations, which will be going away with proper Razor solution snapshots.
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.
Overall looks good. Some nits about location/namespacing that I don't think make sense after this change.
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Hover/ComponentAvailabilityService.cs
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Hover/ComponentAvailabilityService.cs
Show resolved
Hide resolved
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.
Is the plan that there will be some kind of ISolutionSnapshot
available in cohosting and non, and when that happens the GetComponentAvailability
method will get one of them as a parameter?
I can't imagine it working any other way (unless you're planning on introducing a "CurrentSolution" concept in cohosting, but that would be more surprising)
Yes, I was thinking that
I agree that would be surprising and I don't intend on doing that. |
Awesome! I was going to suggest that could be done now by passing an |
When determining what projects a component or tag helper is available within, there is slightly different behavior in the Razor language server vs. co-hosting. In the language server, there is a special case to skip the misc-files project, but that case isn't bothered with in co-hosting. The special case is manifested via different implementations of
ISolutionQueryOperations.GetProjectsContainingDocument(...)
in the language server and co-hosting.This change (which is largely mechanical) introduces a new service,
IComponentAvailabilityService
, that is used to determine what projects a component or tag helper is available within. The intention is that this service contains the behavior difference between the language server and co-hosting rather than relying on ISolutionQueryOperations, which will be going away with proper Razor solution snapshots.