-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Open
Labels
💣 vanQUESTAdded to GH issues that should be removed from Azure DevOpsAdded to GH issues that should be removed from Azure DevOpsdotnet-csharp/svcerrors-warnings/subsvcin-prThis issue will be closed (fixed) by an active pull request.This issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.
Description
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.- declare a class
- specify the class constraint on a generic type parameter.
-
default: goes to a landing page to select the use.- default label of a
switchstatement - default operator or default literal.
- default label of a
-
enum: destination describes declaring an enum.- declare an
enumtype - generic constraint where the base type must be an
enum(derived fromSystem.Enum)
- declare an
-
in: destination is a landing page for user to decide.- specify contravariance in a generic type parameter
- parameter or argument modifier, meaning pass by read-only reference
inas part of aforeachstatement.- part of a
fromclause in a LINQ query expression - part of a
joinclause in a LINQ query expression
-
internal: destination is the page forinternalaccess.internalaccess- part of
protected internalaccess
-
new: goes to thenewexpression page, with a link to the method modifier.- new expressions
- new method declaration modifier
newconstraint on generic type parameter
-
out: landing page for the user to specify- specify covariance on a generic type parameter
- parameter or argument modifier meaning pass by reference, set by called method
-
private: goes toprivateaccess modifierprivateaccess- part of
private protectedaccess modifier
-
protected: goes to the protected access modifierprotectedaccess- part of
protected internalaccess - part of
private protectedaccess
-
ref: goes to the page forrefparameter / argument modifier,refreturn andreflocal. Page has link toref structusage.refparameter / argument modifierrefreturn valuereflocal variable.refstruct declaration
-
staticpage goes to static modifier on class, field, method, local function, or lambda declarationstaticmodifier.- part of the
using staticdirective.
-
struct: page goes tostructdeclarations (which includesref structandreadonly struct.- declare a struct
- specify the
structconstraint on a generic type parameter.
-
thispage is forthisreferring to the current instance of a type- refer to the current instance of a type
- parameter modifier for first argument of an extension method
-
usinggoes to a landing page for different uses.usingdirective-
using staticdirective usingstatement
-
partial: already has separate pages for type and methodpartialtypepartialmethod
-
where: already has separate pages for both usageswhereLINQ query expressionwheregeneric constraint
The 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.
Metadata
Metadata
Assignees
Labels
💣 vanQUESTAdded to GH issues that should be removed from Azure DevOpsAdded to GH issues that should be removed from Azure DevOpsdotnet-csharp/svcerrors-warnings/subsvcin-prThis issue will be closed (fixed) by an active pull request.This issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.