VisualBasicSyntaxTree Class

Definition

The parsed representation of a Visual Basic source document.

public ref class VisualBasicSyntaxTree abstract : Microsoft::CodeAnalysis::SyntaxTree
public abstract class VisualBasicSyntaxTree : Microsoft.CodeAnalysis.SyntaxTree
type VisualBasicSyntaxTree = class
    inherit SyntaxTree
Public MustInherit Class VisualBasicSyntaxTree
Inherits SyntaxTree
Inheritance
VisualBasicSyntaxTree

Constructors

VisualBasicSyntaxTree()

Properties

DiagnosticOptions
Obsolete.

Option to specify custom behavior for each warning in this tree.

(Inherited from SyntaxTree)
Encoding

The text encoding of the source document.

(Inherited from SyntaxTree)
FilePath

The path of the source document file.

(Inherited from SyntaxTree)
HasCompilationUnitRoot

Returns true if this syntax tree has a root with SyntaxKind "CompilationUnit".

(Inherited from SyntaxTree)
Length

The length of the text of the syntax tree.

(Inherited from SyntaxTree)
Options

The options used by the parser to produce the syntax tree.

OptionsCore

Methods

CloneNodeAsRoot<T>(T)

Produces a clone of a VisualBasicSyntaxNode which will have current syntax tree as its parent.

Caller must guarantee that if the same instance of VisualBasicSyntaxNode makes multiple calls to this function, only one result is observable.

Create(VisualBasicSyntaxNode, VisualBasicParseOptions, String, Encoding)

Creates a new syntax tree from a syntax node.

Create(VisualBasicSyntaxNode, VisualBasicParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>)

Creates a new syntax tree from a syntax node.

GetChangedSpans(SyntaxTree)

Produces a pessimistic list of spans that denote the regions of text in this tree that are changed from the text of the old tree.

GetChanges(SyntaxTree)

Gets a list of text changes that when applied to the old tree produce this tree.

GetCompilationUnitRoot(CancellationToken)

Gets the root of the syntax tree statically typed as CompilationUnitSyntax.

GetDiagnostics(CancellationToken)

Gets a list of all the diagnostics in the syntax tree.

GetDiagnostics(SyntaxNode)

Gets a list of all the diagnostics in the sub tree that has the specified node as its root.

GetDiagnostics(SyntaxNodeOrToken)

Gets a list of all the diagnostics in either the sub tree that has the specified node as its root or associated with the token and its related trivia.

GetDiagnostics(SyntaxToken)

Gets a list of all the diagnostics associated with the token and any related trivia.

GetDiagnostics(SyntaxTrivia)

Gets a list of all the diagnostics associated with the trivia.

GetLineMappings(CancellationToken)

Returns empty sequence if there are no line mapping directives in the tree. Otherwise, returns a sequence of pairs of spans: each describing a mapping of a span of the tree between two consecutive #line directives. If the first directive is not on the first line the first pair describes mapping of the span preceding the first directive. The last pair of the sequence describes mapping of the span following the last #line directive.

GetLineMappings(CancellationToken)

Returns empty sequence if there are no line mapping directives in the tree. Otherwise, returns a sequence of pairs of spans: each describing a mapping of a span of the tree between two consecutive #line directives. If the first directive is not on the first line the first pair describes mapping of the span preceding the first directive. The last pair of the sequence describes mapping of the span following the last #line directive.

(Inherited from SyntaxTree)
GetLineSpan(TextSpan, CancellationToken)

Gets the location in terms of path, line and column for a given span.

GetLineVisibility(Int32, CancellationToken)

Returns the visibility for the line at the given position.

GetLocation(TextSpan)

Gets a location for the specified text span.

GetMappedLineSpan(TextSpan, CancellationToken)

Gets the location in terms of path, line and column after applying source line mapping directives (#ExternalSource).

GetReference(SyntaxNode)

Gets a SyntaxReference for a specified syntax node. SyntaxReferences can be used to regain access to a syntax node without keeping the entire tree and source text in memory.

(Inherited from SyntaxTree)
GetRoot(CancellationToken)

Gets the root node of the syntax tree.

GetRootAsync(CancellationToken)

Gets the root node of the syntax tree asynchronously.

GetRootAsyncCore(CancellationToken)
GetRootCore(CancellationToken)
GetText(CancellationToken)

Gets the text of the source document.

(Inherited from SyntaxTree)
GetTextAsync(CancellationToken)

Gets the text of the source document asynchronously.

(Inherited from SyntaxTree)
HasHiddenRegions()
IsEquivalentTo(SyntaxTree, Boolean)

Determines if two trees are the same, disregarding trivia differences.

ParseText(SourceText, VisualBasicParseOptions, String, CancellationToken)

Creates a syntax tree by parsing the source text.

ParseText(SourceText, VisualBasicParseOptions, String, ImmutableDictionary<String,ReportDiagnostic>, CancellationToken)

Creates a syntax tree by parsing the source text.

ParseText(String, VisualBasicParseOptions, String, Encoding, CancellationToken)
ParseText(String, VisualBasicParseOptions, String, Encoding, ImmutableDictionary<String,ReportDiagnostic>, CancellationToken)
ToString()

Returns a String that represents the entire source text of this SyntaxTree.

(Inherited from SyntaxTree)
TryGetRoot(SyntaxNode)

Gets the root of the syntax tree if it is available.

(Inherited from SyntaxTree)
TryGetRoot(VisualBasicSyntaxNode)

Gets the root node of the syntax tree if it is already available.

TryGetRootCore(SyntaxNode)
TryGetText(SourceText)

Gets the syntax tree's text if it is available.

(Inherited from SyntaxTree)
WithChangedText(SourceText)

Creates a new syntax based off this tree using a new source text.

WithDiagnosticOptions(ImmutableDictionary<String,ReportDiagnostic>)
Obsolete.

Returns a new tree whose DiagnosticOptions are the specified value and other properties are copied from the current tree.

(Inherited from SyntaxTree)
WithFilePath(String)

Returns a new tree whose FilePath is the specified node and other properties are copied from the current tree.

(Inherited from SyntaxTree)
WithRootAndOptions(SyntaxNode, ParseOptions)

Returns a new tree whose root and options are as specified and other properties are copied from the current tree.

(Inherited from SyntaxTree)

Extension Methods

GetCompilationUnitRoot(SyntaxTree, CancellationToken)
GetCompilationUnitRoot(SyntaxTree)

Gets the root CompilationUnitSyntax for a specified SyntaxTree.

Applies to