-
Notifications
You must be signed in to change notification settings - Fork 418
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
WIP: New completion service #884
WIP: New completion service #884
Conversation
awesome! I have two questions:
|
The completion service returns the list already sorted as it appears in VS. Note that the list returned by the
Yes, XML documentation is returned by this list, though it is already processed. See the |
} | ||
|
||
var previousItem = previousCompletionList.Items[itemIndex]; | ||
if (!string.Equals(previousItem.DisplayText, displayText)) |
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.
The doc comment makes it sound like setting displayText
is optional, but this will always fail
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.
You're right. I had intended it to be optional. Thanks!
if (completionList == null) | ||
{ | ||
return CompletionModels.CompletionResponse.Empty; | ||
} | ||
|
||
var isSuggestionMode = completionList.SuggestionModeItem != 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.
This loses the placeholder text for the item, and I don't think there is a way to resolve the description text for the builder anymore.
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.
Yup. There's no notion of a "builder" in any of the editors that use OmniSharp. That's very much a VS concept. Ultimately, this is just used on the client side to handle commit characters (if the client has that concept). If OmniSharp supports a client that has a "builder", this end point could easily be augmented by including the necessary properties from the 'SuggestionModeItem', such as 'SuggestionModeDescription'.
{ | ||
Line = endTextLine.LineNumber, | ||
Column = change.TextChange.Span.End - endTextLine.Start | ||
}; |
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.
A helper to go from a TextChange to a Range seems useful
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 do. We may have one and I just didn't spot it.
This looks awesome! Also @CyrusNajmabadi might want to look. |
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.
Every time I had a question... I continued to review and
answered it myself. 😄
This will be good with LSP... that's on my weekend project list.
3cf5878
to
9274ec0
Compare
@DustinCampbell How's this thing coming along? 😃 |
@ruant : It's not dead yet, but I have some tweaks that I need to make before it can be merged. Unfortunately, this is stacked up behind a few other high priority work items. |
this is superseded by #1877 |
This change adds new '/completion' and '/completionItem/resolve' end points for better exposing the Roslyn completion service. In order to make this work, I finally had to make the '/open' and '/close' end points work as well. In order for the workspace to properly handle open/closed states for documents, I added a SourceText wrapper for OmniSharp that allows us to control our own SourceTextContainer instances. FWIW, getting a workspace text layer right is one of the more complex parts of the Roslyn workspace design. I have a lot more I want to do here, such as take advantage of the VS text layer.
cc @Pilchie
TODO: