Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update F1 keywords to disambiguateclass#48506

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
UseKeyword method to make maintenance of suffixes easier
  • Loading branch information
@TheSench
TheSench committedOct 13, 2020
commitc2166f33dde18647af87b30b6d2119f70695c025
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -360,10 +360,10 @@ private static bool TryGetTextForKeyword(SyntaxToken token, ISyntaxFactsService

if (token.IsKind(SyntaxKind.ClassKeyword)) {
if (token.Parent is ClassOrStructConstraintSyntax) {
text ="classconstraint_CSharpKeyword";
text =Keyword("classconstraint");
return true;
} else {
text ="class_CSharpKeyword";
text =Keyword("class");
return true;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can we do the same for struct/new as those are also constraints.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@TheSench feel free to include them in this PR, or not. They are called out indotnet/docs#20799 so we're not going to forget.

They would go to the same file as your current docs PR is changing, so there might be some sense in at least doing that side of things.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Seeing as the build failed due to what appears to be a transient issue, I'll add this and kick off another one. Is there a benefit to creating a new f1_keyword versus just using the existingwhereconstraint_CSharpKeyword one for the constraint form of both of these?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm wondering if we want to introduce a switch ontoken.RawKind here now that the number of special cases has grown a bunch. I'll probably be tackling more of these cases in the next week, so that would be something I consider in the next one, but I'd be interested in direction before I get going on it, if possible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this code is C# specific. So you don't need RawKind (you can use Kind()). I wouldn't really do a switch here. I think the code is clear when it handles each case specifically. There's no need for brevity/perf as this will execute once only on hte rare case of someone hitting f1.

TheSench reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the extra context.

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp