-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Update F1 keywords for tokens with multiple uses #20799
Comments
@BillWagner, What about updating Roslyn to give different F1 keywords when the keyword can have multiple meanings? I recently did this with |
@Youssef1313 Yes, that was the intention with this issue. The docs pages need to be checked and updated with unique |
@davidwengier That's good. I thought the intention was docs-only changes (i.e. the linked page should explain the different semantics about the keyword or contain links that explain them). Thanks for clarifying my misunderstanding. Let me know if I can help with roslyn-side fixes on this. |
I don't think there is much point logging help wanted issues for all of these on the Roslyn side, but if you wanted to contribute the PRs like you did with I've logged dotnet/roslyn#48392 on our side so we at least don't forget :) |
This was previously handled by @davidwengier in dotnet/roslyn#46343. The issue doesn't mention colon ( |
Thanks @Youssef1313 good catch. I've added checkboxes to the OP, and will try to keep things up to date |
More items that are already covered:
Pre-exists Github
|
There is also FYI @davidwengier |
|
A number of C# tokens have different semantics depending on where they appear in the syntax tree. Historically, these tokens have gone to a page for the token, and the reader needs to select a link to the page with the correct content. We can do better. Here are the tokens that have multiple uses, the current page, and the list of uses for that token:
class
: goes to class declaration page.default
: goes to a landing page to select the use.switch
statementenum
: destination describes declaring an enum.enum
typeenum
(derived fromSystem.Enum
)in
: destination is a landing page for user to decide.in
as part of aforeach
statement.from
clause in a LINQ query expressionjoin
clause in a LINQ query expressioninternal
: destination is the page forinternal
access.internal
accessprotected internal
accessnew
: goes to thenew
expression page, with a link to the method modifier.new
constraint on generic type parameterout
: landing page for the user to specifyprivate
: goes toprivate
access modifierprivate
accessprivate protected
access modifierprotected
: goes to the protected access modifierprotected
accessprotected internal
accessprivate protected
accessref
: goes to the page forref
parameter / argument modifier,ref
return andref
local. Page has link toref struct
usage.ref
parameter / argument modifierref
return valueref
local variable.ref
struct declarationstatic
page goes to static modifier on class, field, method, local function, or lambda declarationstatic
modifier.using static
directive.struct
: page goes tostruct
declarations (which includesref struct
andreadonly struct
.struct
constraint on a generic type parameter.this
page is forthis
referring to the current instance of a typeusing
goes to a landing page for different uses.using
directiveusing static
directiveusing
statementpartial
: already has separate pages for type and methodpartial
typepartial
methodwhere
: already has separate pages for both usageswhere
LINQ query expressionwhere
generic constraintThe
readonly
modifier can be used in different contexts, but the meaning is generally the same. It makes sense to keep them on one page.The first step would be to add F1 token meta data for all the correct destination pages. Then, the Visual Studio IDE could update its F1 source to send readers to the updated pages.
/cc @CyrusNajmabadi @davidwengier
The text was updated successfully, but these errors were encountered: