diff --git a/src/server/session.ts b/src/server/session.ts index 8dd0411d077..11c99dfe46c 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -25,8 +25,14 @@ namespace ts.server { return ((1e9 * seconds) + nanoseconds) / 1000000.0; } - function shouldSkipSematicCheck(project: Project) { - return (project.projectKind === ProjectKind.Inferred || project.projectKind === ProjectKind.External) && project.isJsOnlyProject(); + function shouldSkipSemanticCheck(project: Project) { + if (project.projectKind === ProjectKind.Inferred || project.projectKind === ProjectKind.External) { + return project.isJsOnlyProject(); + } + else { + // For configured projects, require that skipLibCheck be set also + return project.getCompilerOptions().skipLibCheck && project.isJsOnlyProject(); + } } interface FileStart { @@ -447,7 +453,7 @@ namespace ts.server { private semanticCheck(file: NormalizedPath, project: Project) { try { let diags: Diagnostic[] = []; - if (!shouldSkipSematicCheck(project)) { + if (!shouldSkipSemanticCheck(project)) { diags = project.getLanguageService().getSemanticDiagnostics(file); } @@ -555,7 +561,7 @@ namespace ts.server { private getDiagnosticsWorker(args: protocol.FileRequestArgs, isSemantic: boolean, selector: (project: Project, file: string) => Diagnostic[], includeLinePosition: boolean) { const { project, file } = this.getFileAndProject(args); - if (isSemantic && shouldSkipSematicCheck(project)) { + if (isSemantic && shouldSkipSemanticCheck(project)) { return []; } const scriptInfo = project.getScriptInfoForNormalizedPath(file);