Skip to content

Commit

Permalink
fix: missing ts declaration diagnostics
Browse files Browse the repository at this point in the history
close #1222
  • Loading branch information
johnsoncodehk committed Apr 21, 2022
1 parent dc7f580 commit e7a3bd9
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -12,6 +12,7 @@ export function register(context: LanguageServiceRuntimeContext) {
{
nonTs: vscode.Diagnostic[],
tsSemantic: vscode.Diagnostic[],
tsDeclaration: vscode.Diagnostic[],
tsSyntactic: vscode.Diagnostic[],
tsSuggestion: vscode.Diagnostic[],
}
Expand All @@ -28,6 +29,7 @@ export function register(context: LanguageServiceRuntimeContext) {
>
>();
const scriptTsCache_semantic: typeof nonTsCache = new Map();
const scriptTsCache_declaration: typeof nonTsCache = new Map();
const scriptTsCache_syntactic: typeof nonTsCache = new Map();
const scriptTsCache_suggestion: typeof nonTsCache = new Map();

Expand All @@ -36,6 +38,7 @@ export function register(context: LanguageServiceRuntimeContext) {
const cache = responseCache.get(uri) ?? responseCache.set(uri, {
nonTs: [],
tsSemantic: [],
tsDeclaration: [],
tsSuggestion: [],
tsSyntactic: [],
}).get(uri)!;
Expand All @@ -53,6 +56,8 @@ export function register(context: LanguageServiceRuntimeContext) {
await worker(true, { suggestion: true }, scriptTsCache_suggestion, errors => cache.tsSuggestion = errors ?? []);
doResponse();
await worker(true, { semantic: true }, scriptTsCache_semantic, errors => cache.tsSemantic = errors ?? []);
doResponse();
await worker(true, { declaration: true }, scriptTsCache_declaration, errors => cache.tsDeclaration = errors ?? []);

return getErrors();

Expand All @@ -69,6 +74,7 @@ export function register(context: LanguageServiceRuntimeContext) {
...cache.tsSyntactic,
...cache.tsSuggestion,
...cache.tsSemantic,
...cache.tsDeclaration,
];
}

Expand Down

0 comments on commit e7a3bd9

Please sign in to comment.