Documentation for CSharpSyntaxWalker constructor needs clarification of "depth" parameter
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 68/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- csharp
- Ambito
- documentation
Direzione di ricerca
Inizia da dotnet/xml/Microsoft.CodeAnalysis.CSharp/CSharpSyntaxWalker.xml, il Content Source indicato nell’issue, e rivedi le voci del costruttore, della classe e della proprietà Depth di CSharpSyntaxWalker. Aggiorna la documentazione per spiegare il comportamento predefinito di Depth, la visita di token e trivia e il significato di Depth; il lavoro è completo quando ogni pagina API richiesta descrive chiaramente questi comportamenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Currently, in a derived syntax walker without an explicit constructor, the syntax walker will not visit tokens or trivia nodes. This is extremely non-obvious.
I wasted about half a day discovering this behavior, confirming it, opening an issue, discovering the underlying cause, and then closing the issue (see #66713).
The documentation desperately needs improvements in this regard.
First, the Constructor page should better explain both the usage and the default value of the terribly named depth parameter. Currently, it lists only the name and data type of the parameter and no additional information. I suggest adding something like the following:
The value of this parameter limits the types of nodes that will be visited. With its default value of
SyntaxWalkerDepth.Node, neither tokens nor trivia are visited.
Next, the Class page should warn that by default this class will not visit tokens or trivia nodes. I suggest adding something like the following:
By default, this class will not visit tokens or trivia. To change this behavior, supply a different value for the
depthparameter of the constructor.
Next, on the same page, the documentation for the Depth property should be improved. Currently, it only provides the property name and no further information. I suggest adding something like the following:
Gets a value that indicates the types of nodes that will be visited.
Finally, on the Property page for Depth, a similar description should be added. Currently, it only provides the name and data type and no further information.
Regarding the poor naming of the parameter and property, the word "depth" generally has a different meaning when referring to a tree data structure. There, it is a measure of the distance between a given node and the root of the tree.
In this class, the name depth refers to a filter that limits the types of nodes that will be visited. While this loosely relates to the previously mentioned concept of "depth", since descent stops at the depth where a node does not match the filter, it is nonetheless poorly named.
Better names include: "depthLimit", "depthFilter", "filter", "limit", and frankly almost anything else 😄
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 7f4df4eb-e177-be67-06f2-6cd65d8cbac9
- Version Independent ID: 0b46d8cb-407a-94ed-a5a0-13528960b2a9
- Content: CSharpSyntaxWalker Class (Microsoft.CodeAnalysis.CSharp)
- Content Source: dotnet/xml/Microsoft.CodeAnalysis.CSharp/CSharpSyntaxWalker.xml
- Product: dotnet-roslyn-api
- Technology: microsoft.codeanalysis
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 4.8k
- Fork
- 6.1k
- Merge medio
- 14h 40m
- PR unite (30g)
- 302
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotnet/docs
-
:watch: Not Triaged dotnet-target-version
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
:watch: Not Triaged dotnet-fundamentals/svc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
:watch: Not Triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dotnet/docs#56285 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add more to the documentationForse già presa @adarsh6980 l’ha presa 11 giorni fa. Apertadotnet-fsharp/svc help wanted
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
dotnet/docs#56209 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
:watch: Not Triaged
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
alphagov/govuk-frontend-docs#668 ·
I maintainer di solito rispondono entro 2 giorni
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
lesson-submission needs-ac pending-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Ikalus1988/MisakaNet#2868 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
bancolombia/scaffold-clean-architecture#1001 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
navikt/esyfo-narmesteleder#615 ·
I maintainer di solito rispondono entro 1 giorno