Skip to content

Commit

Permalink
fix(language-service): fix caching of semantic diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Feb 25, 2024
1 parent fe7f795 commit 74b3600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/language-service/lib/features/provideDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type CacheMap = Map<
string,
{
documentVersion: number,
errors: vscode.Diagnostic[] | undefined | null,
errors: vscode.Diagnostic[],
}
>
>;
Expand Down Expand Up @@ -252,9 +252,9 @@ export function register(context: ServiceContext) {
return cache.errors;
}

const errors = await service[1][api]?.(document, token);
const errors = await service[1][api]?.(document, token) || [];

errors?.forEach(error => {
errors.forEach(error => {
error.data = {
uri,
version: document.version,
Expand Down

0 comments on commit 74b3600

Please sign in to comment.