Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions packages/language-server/src/plugins/PluginHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,13 @@ export class PluginHost implements LSProvider, OnWatchFileChanges {
async getDocumentColors(textDocument: TextDocumentIdentifier): Promise<ColorInformation[]> {
const document = this.getDocument(textDocument.uri);

return (
await this.execute<ColorInformation[]>(
'getDocumentColors',
[document],
ExecuteMode.Collect,
'low'
)
).flat();
const result = await this.execute<ColorInformation[]>(
'getDocumentColors',
[document],
ExecuteMode.Collect,
'low'
);
return result?.flat() ?? [];
}

async getColorPresentations(
Expand Down Expand Up @@ -697,7 +696,7 @@ export class PluginHost implements LSProvider, OnWatchFileChanges {
ExecuteMode.Collect,
'smart'
);
return result.filter(Boolean).flat();
return result?.filter(Boolean).flat();
}

async getFoldingRanges(textDocument: TextDocumentIdentifier): Promise<FoldingRange[]> {
Expand Down
Loading