-
Notifications
You must be signed in to change notification settings - Fork 421
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
Override completion can mess up based on context #1907
Comments
Note there are 2 bugs here:
|
on that note, I think |
I'd prefer |
What I think will work as a simple algorithm for finding the correct position in the change text for override completion is to find the last instance of the text |
Import completion shouldn't have this issue and there's nothing qualified in the DisplayText. |
…sult Override and partial method completion can have scenarios where the DisplayText of the completion item does not appear in the final text, such as when types need to be imported or when nullability differs between original declaration and generation declaration sites. We now handle these by parsing the change if we fail to find the insertion text, and using the last method in the change to find the correct location in the new text. Fixes OmniSharp#1907.
This can happen when the
DisplayText
uses fully-qualified names, but the actual change adds an import, and then minimally qualifies the result/simplifies default/plays around with nullable. This then causes an exception because we assigndefault(ImmutableArray<LinePositionChange>
toadditionalTextEdits
, rather than assigningnull
, which causesNewtonsoft.Json
to barf.The text was updated successfully, but these errors were encountered: