File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
packages/language-server/src/plugins Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -266,14 +266,13 @@ export class PluginHost implements LSProvider, OnWatchFileChanges {
266266 async getDocumentColors ( textDocument : TextDocumentIdentifier ) : Promise < ColorInformation [ ] > {
267267 const document = this . getDocument ( textDocument . uri ) ;
268268
269- return (
270- await this . execute < ColorInformation [ ] > (
271- 'getDocumentColors' ,
272- [ document ] ,
273- ExecuteMode . Collect ,
274- 'low'
275- )
276- ) . flat ( ) ;
269+ const result = await this . execute < ColorInformation [ ] > (
270+ 'getDocumentColors' ,
271+ [ document ] ,
272+ ExecuteMode . Collect ,
273+ 'low'
274+ ) ;
275+ return result ?. flat ( ) ?? [ ] ;
277276 }
278277
279278 async getColorPresentations (
@@ -697,7 +696,7 @@ export class PluginHost implements LSProvider, OnWatchFileChanges {
697696 ExecuteMode . Collect ,
698697 'smart'
699698 ) ;
700- return result . filter ( Boolean ) . flat ( ) ;
699+ return result ? .filter ( Boolean ) . flat ( ) ;
701700 }
702701
703702 async getFoldingRanges ( textDocument : TextDocumentIdentifier ) : Promise < FoldingRange [ ] > {
You can’t perform that action at this time.
0 commit comments