Skip to content

Commit c258f13

Browse files
Keen Yee Liauayazhafiz
authored andcommitted
fix: Show diagnostics only when language service is enabled (#427)
1 parent d1d57eb commit c258f13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/session.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ export class Session {
162162
this.connection.console.error(`Failed to find project for ${filePath}`);
163163
return;
164164
}
165-
project.refreshDiagnostics(); // Show initial diagnostics
165+
if (project.languageServiceEnabled) {
166+
project.refreshDiagnostics(); // Show initial diagnostics
167+
}
166168
}
167169

168170
private onDidCloseTextDocument(params: lsp.DidCloseTextDocumentParams) {
@@ -193,7 +195,7 @@ export class Session {
193195
}
194196

195197
const project = this.projectService.getDefaultProjectForScriptInfo(scriptInfo);
196-
if (!project) {
198+
if (!project || !project.languageServiceEnabled) {
197199
return;
198200
}
199201
project.refreshDiagnostics();

0 commit comments

Comments
 (0)