@@ -76580,7 +76580,7 @@ var ts;
7658076580 var projectRootPath = this.project.getProjectRootPath();
7658176581 for (var _i = 0, outputFiles_1 = outputFiles; _i < outputFiles_1.length; _i++) {
7658276582 var outputFile = outputFiles_1[_i];
76583- var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName));
76583+ var outputFileAbsoluteFileName = ts.getNormalizedAbsolutePath(outputFile.name, ( projectRootPath || projectRootPath === '') ? projectRootPath : ts.getDirectoryPath(scriptInfo.fileName));
7658476584 writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark);
7658576585 }
7658676586 }
@@ -76761,9 +76761,12 @@ var ts;
7676176761 this.ensureProjectDependencyGraphUpToDate();
7676276762 var singleFileResult = scriptInfo.hasMixedContent ? [] : [scriptInfo.fileName];
7676376763 var fileInfo = this.getFileInfo(scriptInfo.path);
76764- if (!fileInfo || !fileInfo.updateShapeSignature() ) {
76764+ if (!fileInfo) {
7676576765 return singleFileResult;
7676676766 }
76767+ if (!fileInfo.updateShapeSignature()) {
76768+ return fileInfo.referencedBy.map(function (info) { return info.scriptInfo.fileName; });
76769+ }
7676776770 if (!fileInfo.isExternalModuleOrHasOnlyAmbientExternalModules()) {
7676876771 return this.project.getAllEmittableFiles();
7676976772 }
@@ -77433,11 +77436,7 @@ var ts;
7743377436 _super.prototype.removeRoot.call(this, info);
7743477437 };
7743577438 InferredProject.prototype.getProjectRootPath = function () {
77436- if (this.projectService.useSingleInferredProject) {
77437- return undefined;
77438- }
77439- var rootFiles = this.getRootFiles();
77440- return ts.getDirectoryPath(rootFiles[0]);
77439+ return '';
7744177440 };
7744277441 InferredProject.prototype.close = function () {
7744377442 _super.prototype.close.call(this);
@@ -77630,10 +77629,12 @@ var ts;
7763077629 }
7763177630 this.typeRootsWatchers = undefined;
7763277631 }
77633- this.directoriesWatchedForWildcards.forEach(function (watcher) {
77634- watcher.close();
77635- });
77636- this.directoriesWatchedForWildcards = undefined;
77632+ if (this.directoriesWatchedForWildcards) {
77633+ this.directoriesWatchedForWildcards.forEach(function (watcher) {
77634+ watcher.close();
77635+ });
77636+ this.directoriesWatchedForWildcards = undefined;
77637+ }
7763777638 this.stopWatchingDirectory();
7763877639 };
7763977640 ConfiguredProject.prototype.addOpenRef = function () {
@@ -77955,6 +77956,32 @@ var ts;
7795577956 var scriptInfo = this.getScriptInfoForNormalizedPath(fileName);
7795677957 return scriptInfo && scriptInfo.getDefaultProject();
7795777958 };
77959+ ProjectService.prototype.getGlobalProject = function () {
77960+ var count = this.configuredProjects.length + this.inferredProjects.length + this.externalProjects.length;
77961+ if (count !== 1) {
77962+ return undefined;
77963+ }
77964+ if (this.configuredProjects.length > 0) {
77965+ return this.configuredProjects[0];
77966+ }
77967+ if (this.inferredProjects.length > 0) {
77968+ return this.inferredProjects[0];
77969+ }
77970+ if (this.externalProjects.length > 0) {
77971+ return this.externalProjects[0];
77972+ }
77973+ };
77974+ ProjectService.prototype.closeGlobalProject = function () {
77975+ if (this.configuredProjects.length > 0) {
77976+ this.removeProject(this.configuredProjects[0]);
77977+ }
77978+ if (this.inferredProjects.length > 0) {
77979+ this.removeProject(this.inferredProjects[0]);
77980+ }
77981+ if (this.externalProjects.length > 0) {
77982+ this.removeProject(this.externalProjects[0]);
77983+ }
77984+ };
7795877985 ProjectService.prototype.ensureInferredProjectsUpToDate = function () {
7795977986 if (this.changedFiles) {
7796077987 var projectsToUpdate = void 0;
@@ -78578,6 +78605,41 @@ var ts;
7857878605 }
7857978606 return project;
7858078607 };
78608+ ProjectService.prototype.createInferredProjectWithRootFileNamesIfNecessary = function (uncheckedFileNames) {
78609+ var _this = this;
78610+ var useExistingProject = this.useSingleInferredProject && this.inferredProjects.length;
78611+ var project = useExistingProject ? this.inferredProjects[0] : new server.InferredProject(this, this.documentRegistry, this.compilerOptionsForInferredProjects);
78612+ for (var _i = 0, uncheckedFileNames_1 = uncheckedFileNames; _i < uncheckedFileNames_1.length; _i++) {
78613+ var uncheckedFileName = uncheckedFileNames_1[_i];
78614+ var info = this.getOrCreateScriptInfo(uncheckedFileName, false);
78615+ project.addRoot(info);
78616+ this.directoryWatchers.startWatchingContainingDirectoriesForFile(info.fileName, project, function (fileName) { return _this.onConfigFileAddedForInferredProject(fileName); });
78617+ }
78618+ project.updateGraph();
78619+ if (!useExistingProject) {
78620+ this.inferredProjects.push(project);
78621+ }
78622+ return project;
78623+ };
78624+ ProjectService.prototype.createConfiguredProjectIfNecessary = function (uncheckedConfigFileName) {
78625+ var configFileName = server.toNormalizedPath(uncheckedConfigFileName);
78626+ this.logger.info("Config file name: " + configFileName);
78627+ var project = this.findConfiguredProjectByProjectName(configFileName);
78628+ if (!project) {
78629+ var _a = this.openConfigFile(configFileName), success = _a.success, errors = _a.errors;
78630+ if (!success) {
78631+ return { configFileName: configFileName, configFileErrors: errors };
78632+ }
78633+ this.logger.info("Opened configuration file " + configFileName);
78634+ if (errors && errors.length > 0) {
78635+ return { configFileName: configFileName, configFileErrors: errors };
78636+ }
78637+ }
78638+ else {
78639+ this.updateConfiguredProject(project);
78640+ }
78641+ return { configFileName: configFileName };
78642+ };
7858178643 ProjectService.prototype.getOrCreateScriptInfo = function (uncheckedFileName, openedByClient, fileContent, scriptKind) {
7858278644 return this.getOrCreateScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName), openedByClient, fileContent, scriptKind);
7858378645 };
@@ -80315,7 +80377,7 @@ var ts;
8031580377 return accum;
8031680378 }, []);
8031780379 if (checkList.length > 0) {
80318- this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay);
80380+ this.updateErrorCheck(next, checkList, this.changeSeq, function (n) { return n === _this.changeSeq; }, delay, 200, false );
8031980381 }
8032080382 };
8032180383 Session.prototype.change = function (args) {
@@ -80603,7 +80665,7 @@ var ts;
8060380665 if (languageServiceDisabled) {
8060480666 return;
8060580667 }
80606- var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0; });
80668+ var fileNamesInProject = fileNames.filter(function (value) { return value.indexOf("lib.d.ts") < 0 && value.indexOf("lib.es6.d.ts") < 0 ; });
8060780669 var highPriorityFiles = [];
8060880670 var mediumPriorityFiles = [];
8060980671 var lowPriorityFiles = [];
@@ -80722,6 +80784,39 @@ var ts;
8072280784 this.output(undefined, request ? request.command : CommandNames.Unknown, request ? request.seq : 0, "Error processing request. " + err.message + "\n" + err.stack);
8072380785 }
8072480786 };
80787+ Session.prototype.getCompilerOptions = function (fileName, projectFileName) {
80788+ if (projectFileName === void 0) { projectFileName = undefined; }
80789+ var project = this.getFileAndProjectWorker(fileName, projectFileName, true, false).project;
80790+ return project.getCompilerOptions();
80791+ };
80792+ Session.prototype.getLanguageService = function (fileName, projectFileName) {
80793+ if (projectFileName === void 0) { projectFileName = undefined; }
80794+ var project = this.getFileAndProjectWorker(fileName, projectFileName, true, false).project;
80795+ return project.getLanguageService();
80796+ };
80797+ Session.prototype.getGlobalCompilerOptions = function () {
80798+ var project = this.projectService.getGlobalProject();
80799+ if (project) {
80800+ return project.getCompilerOptions();
80801+ }
80802+ return undefined;
80803+ };
80804+ Session.prototype.getGlobalLanguageService = function () {
80805+ var project = this.projectService.getGlobalProject();
80806+ if (project) {
80807+ return project.getLanguageService();
80808+ }
80809+ return undefined;
80810+ };
80811+ Session.prototype.createInferredProject = function (fileNames) {
80812+ this.projectService.createInferredProjectWithRootFileNamesIfNecessary(fileNames);
80813+ };
80814+ Session.prototype.createConfiguredProject = function (configFileName) {
80815+ this.projectService.createConfiguredProjectIfNecessary(configFileName);
80816+ };
80817+ Session.prototype.closeGlobalProject = function () {
80818+ this.projectService.closeGlobalProject();
80819+ };
8072580820 return Session;
8072680821 }());
8072780822 server.Session = Session;
@@ -82169,3 +82264,5 @@ var ts;
8216982264 ioSession.listen();
8217082265 })(server = ts.server || (ts.server = {}));
8217182266})(ts || (ts = {}));
82267+
82268+ //# sourceMappingURL=tsserver.js.map
0 commit comments