-
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
Bump LSP Protocol version #8847
Conversation
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.
For tracking, I also filed #8829 for us adding support for InsertReplaceEdit
4016557
to
38587cc
Compare
@@ -100,12 +100,12 @@ internal class DelegatedCompletionItemResolver : CompletionItemResolver | |||
return resolvedCompletionItem; | |||
} | |||
|
|||
if (resolvedCompletionItem.TextEdit is not null) | |||
if (resolvedCompletionItem.TextEdit is { First: var textEdit }) |
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.
Will First
always be non-null? I ask because elsewhere in the PR you're using TryGetFirst
. Is that the difference between a resolved and non-resolved item?
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.
In other places, I grabbed your code, which is why it used TryGetFirst(...)
. I didn't think too hard, but maybe I should. 😄
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.
Oh is this based on my async completion stuff from O#?
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.
Nope. Nothing to do with OmniSharp. I didn't realize that comment was coming from you @333fred. I thought it was coming from @allisonchou, since the two of us are working on this. Sorry to be confusing! I just misread your name. I meant Allison's code. 😄
Roslyn is using a newer version of the LSP Protocol, which results in a
MissingMethodException
at runtime. This is due to the fact that VS supports loading multiple versions of the LSP Protocol simultaneously. Razor compiled against an earlier version, so the LSP client passed LSP Protocol objects originating from that earlier version. However, when Razor tries to pass one of those objects to Roslyn, which is compiled against a newer version of the LSP Protocol, the type of the object doesn't match what Roslyn expects, since they originate from different versions of the LSP Protocol assembly, both of which are loaded.This change also accounts for the new
InsertReplaceEdit
that has been added in this version of the protocol. It's actually due to breaking changes like this that VS supports multiple protocol versions.