Open sandboxFocus

Method TryGetSyntaxTree

TryGetSyntaxTree(DocumentKey, out SyntaxTree?)

Gets the syntax tree of the current subset that represents a given document, and returns false if there is none.

Declaration
bool TryGetSyntaxTree(DocumentKey documentKey, out SyntaxTree? syntaxTree)
Parameters
Type Name Description
DocumentKey documentKey
SyntaxTree syntaxTree
Returns
Type Description
bool
Remarks

At most one syntax tree of an IPartialCompilation represents a document. Roslyn does not guarantee that of a Compilation, so Metalama establishes it: a tree whose path an earlier tree already holds is removed from the compilation before the subset is built. See issue #1742.