5 instantiations of TreeAndVersion
Microsoft.CodeAnalysis.Workspaces (5)
Workspace\Solution\DocumentState.cs (4)
163
return new
TreeAndVersion
(tree, textAndVersion.Version);
241
return new
TreeAndVersion
(newTree, version);
371
newTreeSource = ValueSource.Constant(new
TreeAndVersion
(newTree, existingTreeAndVersion.Version));
554
return (lazyTextAndVersion, new
TreeAndVersion
(tree, treeVersion));
Workspace\Solution\DocumentState_LinkedFileReuse.cs (1)
113
newTreeAndVersion = new
TreeAndVersion
(newTree, siblingVersion);
48 references to TreeAndVersion
Microsoft.CodeAnalysis.Workspaces (48)
Workspace\Solution\DocumentState.cs (31)
34
private readonly ValueSource<
TreeAndVersion
>? _treeSource;
43
ValueSource<
TreeAndVersion
>? treeSource)
82
public ValueSource<
TreeAndVersion
>? TreeSource => _treeSource;
100
protected static ValueSource<
TreeAndVersion
> CreateLazyFullyParsedTree(
108
return new AsyncLazy<
TreeAndVersion
>(
114
private static async Task<
TreeAndVersion
> FullyParseTreeAsync(
130
private static
TreeAndVersion
FullyParseTree(
146
private static
TreeAndVersion
CreateTreeAndVersion(
166
private static ValueSource<
TreeAndVersion
> CreateLazyIncrementallyParsedTree(
167
ValueSource<
TreeAndVersion
> oldTreeSource,
171
return new AsyncLazy<
TreeAndVersion
>(
177
private static async Task<
TreeAndVersion
> IncrementallyParseTreeAsync(
178
ValueSource<
TreeAndVersion
> oldTreeSource,
188
var
oldTreeAndVersion = await oldTreeSource.GetValueAsync(cancellationToken).ConfigureAwait(false);
199
private static
TreeAndVersion
IncrementallyParseTree(
200
ValueSource<
TreeAndVersion
> oldTreeSource,
210
var
oldTreeAndVersion = oldTreeSource.GetValue(cancellationToken);
221
private static
TreeAndVersion
IncrementallyParse(
223
TreeAndVersion
oldTreeAndVersion,
237
private static
TreeAndVersion
MakeNewTreeAndVersion(SyntaxTree oldTree, SourceText oldText, VersionStamp oldVersion, SyntaxTree newTree, SourceText newText, VersionStamp newVersion)
349
ValueSource<
TreeAndVersion
>? newTreeSource = null;
357
_treeSource.TryGetValue(out
var
existingTreeAndVersion))
460
ValueSource<
TreeAndVersion
>? newTreeSource;
534
static (ITextAndVersionSource,
TreeAndVersion
) CreateTreeWithLazyText(
567
if (!_treeSource.TryGetValue(out
var
oldTreeAndVersion) || !oldTreeAndVersion!.Tree.TryGetRoot(out var oldRoot))
592
if (_treeSource != null && _treeSource.TryGetValue(out
var
treeAndVersion) && treeAndVersion != null)
603
if (_treeSource != null && _treeSource.TryGetValue(out
var
treeAndVersion) && treeAndVersion != null)
619
var
treeAndVersion = await _treeSource.GetValueAsync(cancellationToken).ConfigureAwait(false);
631
var
treeAndVersion = _treeSource.GetValue(cancellationToken);
640
if (_treeSource != null && _treeSource.TryGetValue(out
var
treeAndVersion) && treeAndVersion != null)
659
if (_treeSource.TryGetValue(out
var
treeAndVersion) && treeAndVersion != null)
Workspace\Solution\DocumentState_LinkedFileReuse.cs (16)
22
public DocumentState UpdateTextAndTreeContents(ITextAndVersionSource siblingTextSource, ValueSource<
TreeAndVersion
>? siblingTreeSource)
67
static AsyncLazy<
TreeAndVersion
> GetReuseTreeSource(
72
ValueSource<
TreeAndVersion
> treeSource,
74
ValueSource<
TreeAndVersion
> siblingTreeSource)
76
return new AsyncLazy<
TreeAndVersion
>(
89
[NotNullWhen(true)] out
TreeAndVersion
? newTreeAndVersion)
175
static async Task<
TreeAndVersion
> TryReuseSiblingTreeAsync(
180
ValueSource<
TreeAndVersion
> treeSource,
182
ValueSource<
TreeAndVersion
> siblingTreeSource,
185
var
siblingTreeAndVersion = await siblingTreeSource.GetValueAsync(cancellationToken).ConfigureAwait(false);
190
if (TryReuseSiblingRoot(filePath, languageServices, loadTextOptions, parseOptions, siblingRoot, siblingTreeAndVersion.Version, out
var
newTreeAndVersion))
197
static
TreeAndVersion
TryReuseSiblingTree(
202
ValueSource<
TreeAndVersion
> treeSource,
204
ValueSource<
TreeAndVersion
> siblingTreeSource,
207
var
siblingTreeAndVersion = siblingTreeSource.GetValue(cancellationToken);
212
if (TryReuseSiblingRoot(filePath, languageServices, loadTextOptions, parseOptions, siblingRoot, siblingTreeAndVersion.Version, out
var
newTreeAndVersion))
Workspace\Solution\SourceGeneratedDocumentState.cs (1)
59
ValueSource<
TreeAndVersion
> treeSource)