提交 22cdd2c5 编写于 作者: C Cyrus Najmabadi

Avoid a few more allocations in another DocumentState path.

上级 efa39338
...@@ -363,14 +363,19 @@ public new DocumentState UpdateText(TextLoader loader, PreservationMode mode) ...@@ -363,14 +363,19 @@ public new DocumentState UpdateText(TextLoader loader, PreservationMode mode)
? CreateStrongText(loader, this.Id, this.solutionServices, reportInvalidDataException: true) ? CreateStrongText(loader, this.Id, this.solutionServices, reportInvalidDataException: true)
: CreateRecoverableText(loader, this.Id, this.solutionServices, reportInvalidDataException: true); : CreateRecoverableText(loader, this.Id, this.solutionServices, reportInvalidDataException: true);
var newTreeSource = CreateLazyFullyParsedTree( // Only create the ValueSource for creating the SyntaxTree if this is a Document that
newTextSource, // supports SyntaxTrees. There's no point in creating the async lazy and holding onto
this.Id.ProjectId, // this data otherwise.
GetSyntaxTreeFilePath(this.info), var newTreeSource = !this.SupportsSyntaxTree
_options, ? ValueSource<TreeAndVersion>.Empty
_languageServices, : CreateLazyFullyParsedTree(
this.solutionServices, newTextSource,
mode); this.Id.ProjectId,
GetSyntaxTreeFilePath(this.info),
_options,
_languageServices,
this.solutionServices,
mode);
return new DocumentState( return new DocumentState(
this.LanguageServices, this.LanguageServices,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册