diff --git a/src/tscache.ts b/src/tscache.ts index 403e142..a1a3106 100644 --- a/src/tscache.ts +++ b/src/tscache.ts @@ -247,7 +247,8 @@ export class TsCache private getDiagnostics(type: string, cache: ICache, id: string, snapshot: tsTypes.IScriptSnapshot, check: () => tsTypes.Diagnostic[]): IDiagnostics[] { - return this.getCached(cache, id, snapshot, true, () => convertDiagnostic(type, check())); + // don't need to check imports for syntactic diagnostics (per https://github.com/microsoft/TypeScript/wiki/Using-the-Language-Service-API#design-goals) + return this.getCached(cache, id, snapshot, type === "semantic", () => convertDiagnostic(type, check())); } private getCached(cache: ICache, id: string, snapshot: tsTypes.IScriptSnapshot, checkImports: boolean, convert: () => CacheType): CacheType