-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add F1 help keyword for default constraint
#65229
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
CyrusNajmabadi
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.
yup yup , that's it.
I opened dotnet/docs#32184 to do that. |
Youssef1313
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.
LGTM
| if (token.Parent is DefaultSwitchLabelSyntax) | ||
| { | ||
| text = Keyword("defaultcase"); | ||
| return true; | ||
| } | ||
|
|
||
| if (token.Parent is DefaultConstraintSyntax) | ||
| { | ||
| text = Keyword("defaultconstraint"); | ||
| return true; | ||
| } |
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.
Consider handling goto default (not sure which doc page is suitable).
Also #line default
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.
Thanks for the suggestions. Added
I'll let @BillWagner decide, but for goto default we could always go to the page for switch and for #line default we could go to the section for #line preprocessing directive.
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.
we could go to the section
We can't go to a specific section, unfortunately.
But I'll update the page on dotnet/docs to have the new F1 keyword. Edit: Opened dotnet/docs#32197
|
|
||
| if (token.Parent is DefaultSwitchLabelSyntax or GotoStatementSyntax) | ||
| { | ||
| text = Keyword("defaultcase"); |
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 will redirect to https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements
Currently there doesn't seem to be anything about goto default there, but I opened dotnet/docs#32196
| if (token.Parent is DefaultSwitchLabelSyntax) | ||
| { | ||
| text = Keyword("defaultcase"); | ||
| return true; | ||
| } | ||
|
|
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.
Duplicated below
| if (token.Parent is DefaultSwitchLabelSyntax) | |
| { | |
| text = Keyword("defaultcase"); | |
| return true; | |
| } |
| if (token.Parent is LineDirectiveTriviaSyntax) | ||
| { | ||
| text = Keyword("defaultline"); | ||
| return true; | ||
| } |
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.
@BillWagner Where should this go? The proposal? Or is there any conceptual doc for it? Just saw #65229 (comment)
|
@CyrusNajmabadi Made a couple additions since your review. Could you take another look? |
|
thanks! |
Fixes #65210
@CyrusNajmabadi I'm not familiar with F1 help. I just picked a keyword "defaultconstraint" that seems aligned with existing keywords. If I understood correctly, we can ping Bill to add that keyword and point it appropriately?