-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use "NodeIdentifier" for PrimaryLocation
- Loading branch information
1 parent
9870e05
commit 0ebf903
Showing
4 changed files
with
33 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,7 @@ public static SyntaxNode WalkUpParentheses(this SyntaxNode node) | |
AttributeSyntax { Name: { } name } => GetIdentifier(name), | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
martin-strecker-sonarsource
Author
Contributor
|
||
BaseTypeDeclarationSyntax { Identifier: var identifier } => identifier, | ||
ConstructorDeclarationSyntax { Identifier: var identifier } => identifier, | ||
ConstructorInitializerSyntax { ThisOrBaseKeyword: var keyword } => keyword, | ||
ConversionOperatorDeclarationSyntax { Type: { } type } => GetIdentifier(type), | ||
DelegateDeclarationSyntax { Identifier: var identifier } => identifier, | ||
DestructorDeclarationSyntax { Identifier: var identifier } => identifier, | ||
|
@@ -177,8 +178,11 @@ public static SyntaxNode WalkUpParentheses(this SyntaxNode node) | |
PostfixUnaryExpressionSyntax { Operand: { } operand } => GetIdentifier(operand), | ||
UsingDirectiveSyntax { Alias.Name: { } name } => GetIdentifier(name), | ||
VariableDeclaratorSyntax { Identifier: var identifier } => identifier, | ||
{ } implicitNew when ImplicitObjectCreationExpressionSyntaxWrapper.IsInstance(implicitNew) => ((ImplicitObjectCreationExpressionSyntaxWrapper)implicitNew).NewKeyword, | ||
{ } fileScoped when FileScopedNamespaceDeclarationSyntaxWrapper.IsInstance(fileScoped) | ||
&& ((FileScopedNamespaceDeclarationSyntaxWrapper)fileScoped).Name is { } name => GetIdentifier(name), | ||
{ } primary when PrimaryConstructorBaseTypeSyntaxWrapper.IsInstance(primary) | ||
&& ((PrimaryConstructorBaseTypeSyntaxWrapper)primary).Type is { } type => GetIdentifier(type), | ||
{ } refType when RefTypeSyntaxWrapper.IsInstance(refType) => GetIdentifier(((RefTypeSyntaxWrapper)refType).Type), | ||
_ => null | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm not sure if we need to extend this list to cover all the syntaxes with identifiers, but I'll leave a list of some that are missing just to document them: