-
Notifications
You must be signed in to change notification settings - Fork 291
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
Support completionItem/resolve to compute documentation of a code completion item #1938
Conversation
bf7c123
to
dcf2b92
Compare
@swift-ci Please test |
case is CompletionItemResolveRequest: | ||
self = .freestanding |
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.
This is a request, not a notification, right? Also shouldn't it be considered a document request?
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, good catch. Also just noticed that we do have it in the initializers for requests already.
Also shouldn't it be considered a document request?
I don’t think so. It’s not necessary to process any pending edits to resolve a code completion item. Either the session is still valid, in which can we can resolve independently of document edits or not, in which case we will error in either case.
@@ -134,7 +158,6 @@ class CodeCompletionSession { | |||
session.snapshot.uri == snapshot.uri | |||
&& session.position == completionPosition | |||
&& session.compileCommand == compileCommand | |||
&& session.clientSupportsSnippets == clientSupportsSnippets |
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.
Do we need to check whether the capabilities match, or does that not matter?
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 don’t think that we need to. The only case where this would change is if the client initiated a code completion session and then dynamically registered the snippet support capability, which would be very unlikely since any of that dynamic registration would happen all up-front. And if should get it wrong, it’s not going to be a fatal error, the results might just look a little off (eg. no snippets even though client supports them).
…pletion item Fixes swiftlang#1935
dcf2b92
to
f6b83db
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
Fixes #1935