Documentation for CSharpSyntaxWalker constructor needs clarification of "depth" parameter
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với dotnet/xml/Microsoft.CodeAnalysis.CSharp/CSharpSyntaxWalker.xml, Content Source được nêu trong issue, và xem xét các mục về constructor, class và thuộc tính Depth của CSharpSyntaxWalker. Cập nhật tài liệu để giải thích hành vi mặc định của Depth, việc duyệt token và trivia, cũng như ý nghĩa của Depth; được xem là hoàn tất khi mỗi trang API được yêu cầu mô tả rõ ràng các hành vi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 4.8k
- Fork
- 6.1k
- Merge trung bình
- 21 giờ 6 phút
- Pull request đã merge (30 ngày)
- 193
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dotnet/docs
-
How to upgrade to `10.0.4xx`?Đang mởdotnet-fundamentals/svc install/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Upgrade from `net9.0` to LTS (or STS) image tagCó thể đã có người làm @ShyneChikwapulo đã nhận 6 ngày trước. Đang mởdotnet-target-version
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
dotnet/docs#56293 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Documentation for dotnet sln add doesn't mention the --include-references flagCó thể đã có người làm @BartoszKlonowski đã nhận 6 ngày trước. Đang mởdotnet-fundamentals/svc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
dotnet/docs#56289 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add more to the documentationCó thể đã có người làm @adarsh6980 đã nhận 25 ngày trước. Đang mởdotnet-fsharp/svc help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
dotnet/docs#56209 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:watch: Not Triaged
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Đang mởarea: backend documentation priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
snapotter-hq/SnapOtter#2919 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation E-easy good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
The-Swarm-Corporation/swarms-framework-docs#314 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
charles-hood/DiagramCraft#73 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
ontologyportal/sigma-rs#200 ·
Maintainer thường phản hồi trong vòng 1 ngày