Click or drag to resize

VisualBasicSyntaxTree Class



The parsed representation of a Visual Basic source document.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysisSyntaxTree
    Microsoft.CodeAnalysis.VisualBasicVisualBasicSyntaxTree

Namespace:  Microsoft.CodeAnalysis.VisualBasic
Assembly:  Microsoft.CodeAnalysis.VisualBasic (in Microsoft.CodeAnalysis.VisualBasic.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public abstract class VisualBasicSyntaxTree : SyntaxTree

The VisualBasicSyntaxTree type exposes the following members.

Constructors
  NameDescription
Protected methodVisualBasicSyntaxTree
Initializes a new instance of the VisualBasicSyntaxTree class
Top
Properties
  NameDescription
Public propertyEncoding
The text encoding of the source document.
(Inherited from SyntaxTree.)
Public propertyFilePath
The path of the source document file.
(Inherited from SyntaxTree.)
Public propertyHasCompilationUnitRoot
Returns true if this syntax tree has a root with SyntaxKind "CompilationUnit".
(Inherited from SyntaxTree.)
Public propertyLength
The length of the text of the syntax tree.
(Inherited from SyntaxTree.)
Public propertyOptions
The options used by the parser to produce the syntax tree.
Protected propertyOptionsCore (Overrides SyntaxTreeOptionsCore.)
Top
Methods
  NameDescription
Protected methodCloneNodeAsRootT
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.
Public methodStatic memberCreate
Creates a new syntax tree from a syntax node.
Public methodGetChangedSpans (Overrides SyntaxTreeGetChangedSpans(Void).)
Public methodGetChanges (Overrides SyntaxTreeGetChanges(Void).)
Public methodGetCompilationUnitRoot
Gets the root of the syntax tree statically typed as CompilationUnitSyntax.
Public methodGetDiagnostics(Void) (Overrides SyntaxTreeGetDiagnostics(Void).)
Public methodGetLineSpan(TextSpan, CancellationToken)
Gets the location in terms of path, line and column for a given span.
(Inherited from SyntaxTree.)
Public methodGetLineSpan(TextSpan, CancellationToken)
Gets the location in terms of path, line and column for a given span.
Public methodGetLineVisibility(Int32, CancellationToken)
Returns the visibility for the line at the given position.
(Inherited from SyntaxTree.)
Public methodGetLineVisibility(Int32, CancellationToken)
Public methodGetLocation
Gets a location for the specified text span.
(Overrides SyntaxTreeGetLocation(TextSpan).)
Public methodGetMappedLineSpan(TextSpan, CancellationToken)
Gets the location in terms of path, line and column after applying source line mapping directives (
#line
in C# or
#ExternalSource
in VB).
(Inherited from SyntaxTree.)
Public methodGetMappedLineSpan(TextSpan, CancellationToken)
Gets the location in terms of path, line and column after applying source line mapping directives (#ExternalSource).
Public methodGetReference
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.)
Public methodGetRoot(CancellationToken)
Gets the root node of the syntax tree, causing computation if necessary.
(Inherited from SyntaxTree.)
Public methodGetRoot(CancellationToken)
Gets the root node of the syntax tree.
Public methodGetRootAsync
Protected methodGetRootAsyncCore (Overrides SyntaxTreeGetRootAsyncCore(Void).)
Protected methodGetRootCore(CancellationToken)
Gets the root node of the syntax tree, causing computation if necessary.
(Inherited from SyntaxTree.)
Protected methodGetRootCore(CancellationToken)
Public methodGetText
Gets the text of the source document.
(Inherited from SyntaxTree.)
Public methodGetTextAsync (Inherited from SyntaxTree.)
Public methodHasHiddenRegions (Overrides SyntaxTreeHasHiddenRegions.)
Public methodIsEquivalentTo
Determines if two trees are the same, disregarding trivia differences.
(Overrides SyntaxTreeIsEquivalentTo(SyntaxTree, Boolean).)
Public methodStatic memberParseText(SourceText, VisualBasicParseOptions, String, CancellationToken)
Creates a syntax tree by parsing the source text.
Public methodStatic memberParseText(String, VisualBasicParseOptions, String, Encoding, CancellationToken)
Public methodToString
Returns a String that represents the entire source text of this SyntaxTree.
(Inherited from SyntaxTree.)
Public methodTryGetRoot(SyntaxNode)
Gets the root of the syntax tree if it is available.
(Inherited from SyntaxTree.)
Public methodTryGetRoot(VisualBasicSyntaxNode)
Gets the root node of the syntax tree if it is already available.
Protected methodTryGetRootCore (Overrides SyntaxTreeTryGetRootCore(SyntaxNode).)
Public methodTryGetText
Gets the syntax tree's text if it is available.
(Inherited from SyntaxTree.)
Public methodWithChangedText
Creates a new syntax based off this tree using a new source text.
(Overrides SyntaxTreeWithChangedText(SourceText).)
Public methodWithFilePath
Returns a new tree whose FilePath is the specified node and other properties are copied from the current tree.
(Inherited from SyntaxTree.)
Public methodWithRootAndOptions
Returns a new tree whose root and options are as specified and other properties are copied from the current tree.
(Inherited from SyntaxTree.)
Top
Extension Methods
  NameDescription
Public Extension MethodGetCompilationUnitRootOverloaded.
Gets the root CompilationUnitSyntax for a specified SyntaxTree.
(Defined by VisualBasicExtensions.)
Public Extension MethodGetCompilationUnitRoot(CancellationToken)Overloaded. (Defined by CSharpExtensions.)
Top
See Also