SyntaxGenerator.GetDeclaration Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetDeclaration(SyntaxNode) |
Returns the node if it is a declaration, the immediate enclosing declaration if one exists, or null. |
GetDeclaration(SyntaxNode, DeclarationKind) |
Returns the enclosing declaration of the specified kind or null. |
GetDeclaration(SyntaxNode)
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
Returns the node if it is a declaration, the immediate enclosing declaration if one exists, or null.
public:
Microsoft::CodeAnalysis::SyntaxNode ^ GetDeclaration(Microsoft::CodeAnalysis::SyntaxNode ^ node);
public Microsoft.CodeAnalysis.SyntaxNode GetDeclaration (Microsoft.CodeAnalysis.SyntaxNode node);
public Microsoft.CodeAnalysis.SyntaxNode? GetDeclaration (Microsoft.CodeAnalysis.SyntaxNode? node);
member this.GetDeclaration : Microsoft.CodeAnalysis.SyntaxNode -> Microsoft.CodeAnalysis.SyntaxNode
Public Function GetDeclaration (node As SyntaxNode) As SyntaxNode
Parameters
- node
- SyntaxNode
Returns
Applies to
GetDeclaration(SyntaxNode, DeclarationKind)
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
- Source:
- SyntaxGenerator.cs
Returns the enclosing declaration of the specified kind or null.
public:
Microsoft::CodeAnalysis::SyntaxNode ^ GetDeclaration(Microsoft::CodeAnalysis::SyntaxNode ^ node, Microsoft::CodeAnalysis::Editing::DeclarationKind kind);
public Microsoft.CodeAnalysis.SyntaxNode GetDeclaration (Microsoft.CodeAnalysis.SyntaxNode node, Microsoft.CodeAnalysis.Editing.DeclarationKind kind);
public Microsoft.CodeAnalysis.SyntaxNode? GetDeclaration (Microsoft.CodeAnalysis.SyntaxNode? node, Microsoft.CodeAnalysis.Editing.DeclarationKind kind);
member this.GetDeclaration : Microsoft.CodeAnalysis.SyntaxNode * Microsoft.CodeAnalysis.Editing.DeclarationKind -> Microsoft.CodeAnalysis.SyntaxNode
Public Function GetDeclaration (node As SyntaxNode, kind As DeclarationKind) As SyntaxNode
Parameters
- node
- SyntaxNode
- kind
- DeclarationKind
Returns
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.