Documentation for CSharpSyntaxWalker constructor needs clarification of "depth" parameter
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- csharp
調査の方向性
dotnet/xml/Microsoft.CodeAnalysis.CSharp/CSharpSyntaxWalker.xml から始め、issue で指定されている Content Source を確認し、CSharpSyntaxWalker のコンストラクター、クラス、Depth プロパティのエントリをレビューします。Depth の既定の動作、token と trivia の訪問、および Depth の意味を説明するようにドキュメントを更新します。完了とは、要求された各 API ページでこれらの動作が明確に説明されていることです。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- 言語のデータがありません
- スター
- 4.8k
- フォーク
- 6.1k
- 平均マージ
- 14時間 55分
- マージ済み PR(30日)
- 315
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/docs のほかの issue
-
:watch: Not Triaged dotnet-target-version
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged dotnet-fundamentals/svc
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
dotnet/docs#56289 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dotnet/docs#56285 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add more to the documentation対応中かも @adarsh6980 が 12 日前に担当しました。 オープンdotnet-fsharp/svc help wanted
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
dotnet/docs#56209 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
:watch: Not Triaged
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
yetone/magpie#1032 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
MicrosoftLearning/PL-400_Microsoft-Power-Platform-Developer#231 ·
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
VenetoStato/giorgio#6 ·
-
specification
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
WICG/webmonetization#754 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
linagora/twake-on-matrix#3446 ·
メンテナーはふだん 3 日以内に返信