-
Notifications
You must be signed in to change notification settings - Fork 229
Make cohosting win over legacy editor #11959
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
Make cohosting win over legacy editor #11959
Conversation
| { | ||
| // The editor can send us a document symbol request in a .NET Framework project for some reason, so we have to be | ||
| // a little defensive here. | ||
| if (context.TextDocument is null) |
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.
I was tempted to put this null check in Roslyn, or a base class in this repo, but it seems like there are only two endpoints that need it (for .NET Framework projects at least) so I'll leave that for #11942 when I tackle incompatible .NET Core projects
| _lspEditorFeatureDetector.IsDotNetCoreProject(filePath)) | ||
| { | ||
| contentType = _contentTypeRegistryService.GetContentType(RazorConstants.RazorLSPContentTypeName); | ||
| return true; |
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.
nit: understanding it's trivial, stills seems a bit funky to have two separate ifs next to each other with the same exact body. not asking to change necessarily, just wanted to mention it was the only thing i had to look at twice - "are they both doing them same thing? next to each other?" (obviously for different conditions)
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.
Fair point, I'll extract some things to methods
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.
Makes it easier to read IMHO, thank you!
alexgav
left a comment
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.
![]()
Fixes #11941
This change means that if cohosting is on, we'll always use LSP, except for .NET Framework projects which will fall back to the really really legacy legacy editor. That editor has no interaction with any of our code, except the VS editor does send us a couple of LSP methods (because dynamic registration is by file extension, not content type) so we have to be a tiny bit defensive.