-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Document SyntaxKinds #47257
Document SyntaxKinds #47257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. The point is that the tokens don't represent anything. They're just tokens. A *
could appear anywhere. The kind just tells you what textual form it has. You can tell what it means (i.e. if it's multiplication, or pointer type, or pointer deref, or funcptr, etc.) From the syntax and semantic operations available.
Or, if you are going to doc the token kinds, they should be more like: represents a |
@CyrusNajmabadi Thanks for review! |
@CyrusNajmabadi I've added more XML docs. Can you review what I've so far? I think some keywords are for compiler usage only, but I'm not aware of all of them. Can you point to them to add a note indicating that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The closing </c>
tags are currently malformed
Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
Merge master into patch-7
Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
@Youssef1313 Looks like we need a |
@sharwell I'll add it when I continue documenting the rest of the enum. There are still many undocumented members. Or do you want to merge it as is now and open a follow-up a PR? |
@Youssef1313 I'd be fine with including the part we have here and looking at the next set in a follow-up. |
@@ -4,6 +4,8 @@ | |||
|
|||
#nullable enable | |||
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharwell, CI is failing here with error CS0234 The type or namespace name 'Syntax' does not exist in the namespace 'Microsoft.CodeAnalysis.CSharp'
This doesn't happen with me in Visual Studio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is occurring because SyntaxKinds.cs is linked into the code generation projects. You may need to wrap this in #if
so it's only used for the Microsoft.CodeAnalysis.CSharp project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharwell, Microsoft.CodeAnalysis.CSharp.csproj doesn't currently contain any DefineConstants
. Do I need to add a new one and use if for the #if
directive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other option is to use a fully-qualified cref
attribute:
<see cref="T:Microsoft.CodeAnalysis.CSharp.Syntax.OmittedTypeArgumentSyntax"/>
Co-authored-by: Sam Harwell <sam@tunnelvisionlabs.com>
@sharwell, error CA1200: Avoid using cref tags with a prefix Should I disable CA1200 in editorconfig? or in a ruleset file? or inline in the same file only? or a GlobalSuppressions.cs? |
I would disable it in just this file using a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 16). @dotnet/roslyn-compiler for a second review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 16)
After completing, it should fix dotnet/docs#20344 (this will be in a follow-up PR).
I added XML docs for the first few SyntaxKinds that I know, and kept a TODO for what I don't know.
Steps in my mind to complete this: