MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeSource­Reference
Open sandboxFocus

SourceReference Class

Represents a syntax node in source code.

Inheritance
System.Object
SourceReference
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class SourceReference : ValueType

Properties

Name Description
DiagnosticLocation

Gets the location where the diagnostic should be reported for the current syntax. Typically this is the identifier of the declaration, but the location can be a keyword for nodes that do not have an identifier.

IsImplementationPart

Gets a value indicating whether the current syntax node is contains the implementation of the declaration. This property evaluates to false only for partial methods without implementation.

Kind

Gets the SyntaxKind of the node or token.

NodeOrToken

Gets the Roslyn SyntaxNode, SyntaxToken. This property can be used by SDK-based plugins.

Span

Gets source file, line and column for the node.

Methods

Name Description
GetText(Boolean)

Gets the text representation (i.e. the source code) of the current syntax node or token.

ToString()

Gets the content of the node or token (without trivia).