Skip to content

Commit

Permalink
Syntax only server creates inferred project with all the open files w…
Browse files Browse the repository at this point in the history
…ith noResolve and can handle semantic operations
  • Loading branch information
sheetalkamat committed May 13, 2020
1 parent 9725d62 commit 5726838
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/server/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ namespace ts.server {
this.compilerOptions.allowNonTsExtensions = true;
}

this.languageServiceEnabled = !projectService.syntaxOnly;
this.languageServiceEnabled = true;
if (projectService.syntaxOnly) {
this.compilerOptions.noResolve = true;
}

this.setInternalCompilerOptionsForEmittingJsFiles();
const host = this.projectService.host;
Expand All @@ -296,7 +299,7 @@ namespace ts.server {

// Use the current directory as resolution root only if the project created using current directory string
this.resolutionCache = createResolutionCache(this, currentDirectory && this.currentDirectory, /*logChangesWhenResolvingModule*/ true);
this.languageService = createLanguageService(this, this.documentRegistry, projectService.syntaxOnly);
this.languageService = createLanguageService(this, this.documentRegistry);
if (lastFileExceededProgramSize) {
this.disableLanguageService(lastFileExceededProgramSize);
}
Expand Down Expand Up @@ -618,7 +621,7 @@ namespace ts.server {
}

enableLanguageService() {
if (this.languageServiceEnabled || this.projectService.syntaxOnly) {
if (this.languageServiceEnabled) {
return;
}
this.languageServiceEnabled = true;
Expand All @@ -630,7 +633,6 @@ namespace ts.server {
if (!this.languageServiceEnabled) {
return;
}
Debug.assert(!this.projectService.syntaxOnly);
this.languageService.cleanupSemanticCache();
this.languageServiceEnabled = false;
this.lastFileExceededProgramSize = lastFileExceededProgramSize;
Expand Down

0 comments on commit 5726838

Please sign in to comment.