Feedback from the PR

This commit is contained in:
Sheetal Nandi
2017-08-08 15:12:02 -07:00
parent ae87838f45
commit 65521bc259
6 changed files with 91 additions and 44 deletions
+1 -8
View File
@@ -665,14 +665,7 @@ namespace ts.server {
const configFileSpecs = project.configFileSpecs;
const result = getFileNamesFromConfigSpecs(configFileSpecs, getDirectoryPath(configFilename), project.getCompilerOptions(), project.getCachedServerHost(), this.hostConfiguration.extraFileExtensions);
const errors = project.getAllProjectErrors();
const isErrorNoInputFiles = (error: Diagnostic) => error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code;
if (result.fileNames.length !== 0) {
filterMutate(errors, error => !isErrorNoInputFiles(error));
}
else if (!configFileSpecs.filesSpecs && !some(errors, isErrorNoInputFiles)) {
errors.push(getErrorForNoInputFiles(configFileSpecs, configFilename));
}
project.updateErrorOnNoInputFiles(result.fileNames.length !== 0);
this.updateNonInferredProjectFiles(project, result.fileNames, fileNamePropertyReader, /*clientFileName*/ undefined);
this.delayUpdateProjectGraphAndInferredProjectsRefresh(project);
}
+10
View File
@@ -1226,6 +1226,16 @@ namespace ts.server {
getEffectiveTypeRoots() {
return getEffectiveTypeRoots(this.getCompilerOptions(), this.lsHost.host) || [];
}
/*@internal*/
updateErrorOnNoInputFiles(hasFileNames: boolean) {
if (hasFileNames) {
filterMutate(this.projectErrors, error => !isErrorNoInputFiles(error));
}
else if (!this.configFileSpecs.filesSpecs && !some(this.projectErrors, isErrorNoInputFiles)) {
this.projectErrors.push(getErrorForNoInputFiles(this.configFileSpecs, this.getConfigFilePath()));
}
}
}
/**