![]() | Document Class |
Namespace: Microsoft.CodeAnalysis
The Document type exposes the following members.
Name | Description | |
---|---|---|
![]() | FilePath |
The path to the document file or null if there is no document file.
(Inherited from TextDocument.) |
![]() | Folders |
The sequence of logical folders the document is contained in.
(Inherited from TextDocument.) |
![]() | Id |
The document's identifier. Many document instances may share the same ID, but only one
document in a solution may have that ID.
(Inherited from TextDocument.) |
![]() | Name |
The name of the document.
(Inherited from TextDocument.) |
![]() | Project |
The project this document belongs to.
(Inherited from TextDocument.) |
![]() | SourceCodeKind |
The kind of source code this document contains.
|
![]() | SupportsSemanticModel | |
![]() | SupportsSyntaxTree |
Name | Description | |
---|---|---|
![]() | GetLinkedDocumentIds |
Gets the list of DocumentIds that are linked to this
Document. Documents are considered to be linked if they
share the same FilePath. This DocumentId is excluded from the
result.
|
![]() | GetOptionsAsync | |
![]() | GetSemanticModelAsync | |
![]() | GetSyntaxRootAsync | |
![]() | GetSyntaxTreeAsync | |
![]() | GetSyntaxVersionAsync | |
![]() | GetTextAsync | (Inherited from TextDocument.) |
![]() | GetTextChangesAsync | |
![]() | GetTextVersionAsync | (Inherited from TextDocument.) |
![]() | TryGetSemanticModel |
Gets the current semantic model for this document if the model is already computed and still cached.
In almost all cases, you should call GetSemanticModelAsync(CancellationToken), which will compute the semantic model
if necessary.
|
![]() | TryGetSyntaxRoot |
Gets the root node of the current syntax tree if the syntax tree has already been parsed and the tree is still cached.
In almost all cases, you should call GetSyntaxRootAsync(CancellationToken) to fetch the root node, which will parse
the document if necessary.
|
![]() | TryGetSyntaxTree |
Get the current syntax tree for the document if the text is already loaded and the tree is already parsed.
In almost all cases, you should call GetSyntaxTreeAsync(CancellationToken) to fetch the tree, which will parse the tree
if it's not already parsed.
|
![]() | TryGetSyntaxVersion |
Get the current syntax tree version for the document if the text is already loaded and the tree is already parsed.
In almost all cases, you should call GetSyntaxVersionAsync(CancellationToken) to fetch the version, which will load the tree
if it's not already available.
|
![]() | TryGetText |
Get the current text for the document if it is already loaded and available.
(Inherited from TextDocument.) |
![]() | TryGetTextVersion |
Gets the version of the document's text if it is already loaded and available.
(Inherited from TextDocument.) |
![]() | WithFilePath |
Creates a new instance of this document updated to have the specified file path.
|
![]() | WithFolders | |
![]() | WithName |
Creates a new instance of this document updated to have the specified name.
|
![]() | WithSourceCodeKind |
Creates a new instance of this document updated to have the source code kind specified.
|
![]() | WithSyntaxRoot |
Creates a new instance of this document updated to have a syntax tree rooted by the specified syntax node.
|
![]() | WithText |
Creates a new instance of this document updated to have the text specified.
|