Handle more cases in F1 help service#60156
Conversation
|
|
||
| if (token.IsKind(SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken) && token.Parent.IsKind(SyntaxKind.TypeParameterList, SyntaxKind.TypeArgumentList)) | ||
| { | ||
| text = Keyword("generics"); |
There was a problem hiding this comment.
I'm using the Keyword call for consistency, but let me know if I shouldn't use it in this case.
Youssef1313
left a comment
There was a problem hiding this comment.
@RikkiGibson FYI we will need to handle !!. But it's waiting on dotnet/docs#28443. Do you want a tracking issue for this?
| return true; | ||
| } | ||
|
|
||
| if (token.IsKind(SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken) && token.Parent.IsKind(SyntaxKind.TypeParameterList, SyntaxKind.TypeArgumentList)) |
There was a problem hiding this comment.
Note to self:
TODO:
< and > in:
- FunctionPointerParameterListSyntax
- RelationalPatternSyntax
- XML doc comments (OperatorMemberCrefSyntax, XmlElementStartTagSyntax, XmlEmptyElementSyntax)
@davidwengier @CyrusNajmabadi Is it worth handling < and > in XML doc comments?
|
|
||
| var result = TryGetText(token, semanticModel, document, cancellationToken); | ||
| if (string.IsNullOrEmpty(result)) | ||
| if (result is null) |
There was a problem hiding this comment.
@CyrusNajmabadi I changed the path that returns string.Empty to return null instead. Just simplifies the check and allows me to use ?? below. We're also now more consistent. Previously we were returning null in some cases, and string.Empty in other cases. Both had the same meaning of "we don't have an F1 keyword".
|
|
||
| return result; | ||
| // This redirects to https://docs.microsoft.com/visualstudio/ide/not-in-toc/default, indicating nothing is found. | ||
| return result ?? "vs.texteditor"; |
There was a problem hiding this comment.
can you make a constant for this at the top of the file and doc that?
| // PROTOTYPE: Figure out where to redirect. | ||
|
|
There was a problem hiding this comment.
@BillWagner @333fred Is there a documentation page we can redirect to here?
There was a problem hiding this comment.
Not yet. I'll ping you and @RikkiGibson on the docs issue referenced below when I open that PR.
There was a problem hiding this comment.
@BillWagner Sorry for not clarifying. This was about function pointers
I found now that https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/unsafe-code is the most suitable page.
Opened dotnet/docs#28669.
No thanks, I'll just subscribe to the docs issue. |
Fixes #60154
Fixes #51878
Handles different meanings of EqualsToken (part of Improve F1 help for tokens with multiple uses #48392).
Handles
yield returnandyield break(F1 keyword help forprivate protectedshould not send you to help forprivateorprotected#23881 (comment))docs PR: dotnet/docs#28653 dotnet/docs#28660
@davidwengier @CyrusNajmabadi Can you take a look? Thanks!