File tree Expand file tree Collapse file tree
src/Acuminator/Acuminator.Vsix/Coloriser Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments