Skip to content

Commit 26aab1c

Browse files
committed
ATR-966: added clearing of LastTaggingWasSuccessful from the Copilot remark
1 parent bfccbad commit 26aab1c

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/Acuminator/Acuminator.Vsix/Coloriser/PXRoslynColorizerTagger.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,29 @@ protected internal async Task<IEnumerable<ITagSpan<IClassificationTag>>> GetTags
177177
ClassificationTagsCache.SetCancellation(cToken);
178178
OutliningsTagsCache.SetCancellation(cToken);
179179

180-
Task<ParsedDocument?> getDocumentTask = ParsedDocument.ResolveAsync(snapshot, cToken);
180+
Task<ParsedDocument?> getDocumentTask = ParsedDocument.ResolveAsync(snapshot, cToken); // Razor cshtml returns a null document for some reason.
181181

182-
if (cToken.IsCancellationRequested) // Razor cshtml returns a null document for some reason.
183-
return ClassificationTagsCache.ProcessedTags;
182+
if (cToken.IsCancellationRequested)
183+
{
184+
LastTaggingWasSuccessful = false;
185+
return [];
186+
}
184187

185188
var documentTaskResult = await getDocumentTask.TryAwait();
186189

187190
if (!documentTaskResult.IsSuccess)
188-
return ClassificationTagsCache.ProcessedTags;
191+
{
192+
LastTaggingWasSuccessful = false;
193+
return [];
194+
}
189195

190196
ParsedDocument? document = documentTaskResult.Result;
191197

192198
if (document == null || cToken.IsCancellationRequested)
193-
return ClassificationTagsCache.ProcessedTags;
199+
{
200+
LastTaggingWasSuccessful = false;
201+
return [];
202+
}
194203

195204
bool completedSuccessfully = await WalkDocumentSyntaxTreeForTagsOnThreadPoolAsync(document, cToken).TryAwait();
196205
LastTaggingWasSuccessful = completedSuccessfully && ClassificationTagsCache.IsCompleted;

0 commit comments

Comments
 (0)