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