-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Show warning for unavailable overload in Signature Help #50552
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
Conversation
src/Features/Core/Portable/SignatureHelp/AbstractSignatureHelpProvider.cs
Show resolved
Hide resolved
|
Ping @CyrusNajmabadi for review. Thanks! |
allisonchou
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.
I don't know much about the signature help area at all, but (as far as I can tell) this lgtm🎉
| </Workspace>"; | ||
|
|
||
| var expectedDescription = new SignatureHelpTestItem($"void C.Do(int x)", currentParameterIndex: 0); | ||
| var expectedDescription = new SignatureHelpTestItem($"void C.Do(int x)\r\n\r\n{string.Format(FeaturesResources._0_1, "Proj1", FeaturesResources.Available)}\r\n{string.Format(FeaturesResources._0_1, "Proj2", FeaturesResources.Not_Available)}\r\n\r\n{FeaturesResources.You_can_use_the_navigation_bar_to_switch_context}", currentParameterIndex: 0); |
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'm not totally sure about this, but should the text here read: "You can use the navigation bar to switch contexts" (i.e. with the plural form of context)? I could be wrong, plus I see this string wasn't even declared in this PR, so probably not a big deal.
As an aside, I think "navigation bar" as a term isn't very intuitive, but I don't know of a better alternative. For example, when I first heard the term "navigation bar" I had to ask someone on the team what it was, because even searching the term on a search engine didn't pull up relevant results. Although this is likely unrelated to this PR, and just a comment about improving documentation in general. 😆
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.
should the text here read: "You can use the navigation bar to switch contexts" (i.e. with the plural form of context)?
My English is so broken so I will trust you on this :D
I can send up a follow up PR to fix this.
I think "navigation bar" as a term isn't very intuitive
It's the official name, and this is the first result for "navigation bar visual studio" returned by google as of now, so I will stick to it
https://docs.microsoft.com/en-us/visualstudio/ide/navigating-code?view=vs-2019
| var syntaxFacts = document.GetLanguageService<ISyntaxFactsService>(); | ||
| var anonymousTypeDisplayService = document.GetRequiredLanguageService<IAnonymousTypeDisplayService>(); | ||
| var documentationCommentFormatter = document.GetRequiredLanguageService<IDocumentationCommentFormattingService>(); | ||
| var textSpan = SignatureHelpUtilities.GetSignatureHelpSpan(attribute.ArgumentList!); |
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.
super nit: Instead of using ! here and in other areas, would it potentially be more readable if Contract checks were used instead? It would also allow us to throw sooner if there's an issue. It's probably personal preference though, and I also don't know if there's a fundamental difference between the two approaches I'm missing.
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.
That's a good point. I've been using ! mostly, guess I will be using Contract.ThrowIfNull going forward :)
| class C | ||
| {{ | ||
| public void M(object o) => false; | ||
| #if TFM |
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.
Okay, I have to ask what is probably a super basic question here, but what is "TFM" out of curiosity?
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.
TFM = target framework moniker
Also, this seems OK to me. 👍 I like the unicode char. |
This issue was introduced by dotnet#50552 and caused signature help to misbehave while typing.
Partially address #48058 by showing warning in signature help for symbol unavailable in one of the related documents.
We discussed about adding a warning icon, but it seems only text is supported in VS (see this). I tried to add a unicode char "⚠" in the description text (see screenshot below, not that this change is not included in this PR), however, it means the same char will show up in the description of completion items as well. Thoughts?