@@ -3648,10 +3648,6 @@ var ts;
36483648 return path;
36493649 }
36503650 ts.removeTrailingDirectorySeparator = removeTrailingDirectorySeparator;
3651- /**
3652- * Adds a trailing directory separator to a path, if it does not already have one.
3653- * @param path The path.
3654- */
36553651 function ensureTrailingDirectorySeparator(path) {
36563652 if (path.charAt(path.length - 1) !== ts.directorySeparator) {
36573653 return path + ts.directorySeparator;
@@ -11497,6 +11493,10 @@ var ts;
1149711493 || kind === 251 /* MissingDeclaration */;
1149811494 }
1149911495 ts.isTypeElement = isTypeElement;
11496+ function isClassOrTypeElement(node) {
11497+ return isTypeElement(node) || isClassElement(node);
11498+ }
11499+ ts.isClassOrTypeElement = isClassOrTypeElement;
1150011500 function isObjectLiteralElementLike(node) {
1150111501 var kind = node.kind;
1150211502 return kind === 268 /* PropertyAssignment */
@@ -94878,10 +94878,7 @@ var ts;
9487894878 }
9487994879 };
9488094880 ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) {
94881- if (ts.isStatementButNotDeclaration(after) ||
94882- after.kind === 151 /* PropertyDeclaration */ ||
94883- after.kind === 150 /* PropertySignature */ ||
94884- after.kind === 152 /* MethodSignature */) {
94881+ if (needSemicolonBetween(after, newNode)) {
9488594882 // check if previous statement ends with semicolon
9488694883 // if not - insert semicolon to preserve the code from changing the meaning due to ASI
9488794884 if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) {
@@ -94901,7 +94898,7 @@ var ts;
9490194898 if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) {
9490294899 return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
9490394900 }
94904- else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement (node)) {
94901+ else if (ts.isStatement(node) || ts.isClassOrTypeElement (node)) {
9490594902 return { suffix: this.newLineCharacter };
9490694903 }
9490794904 else if (ts.isVariableDeclaration(node)) {
@@ -95335,6 +95332,10 @@ var ts;
9533595332 }
9533695333 }
9533795334 }
95335+ function needSemicolonBetween(a, b) {
95336+ return (ts.isPropertySignature(a) || ts.isPropertyDeclaration(a)) && ts.isClassOrTypeElement(b) && b.name.kind === 146 /* ComputedPropertyName */
95337+ || ts.isStatementButNotDeclaration(a) && ts.isStatementButNotDeclaration(b); // TODO: only if b would start with a `(` or `[`
95338+ }
9533895339 })(textChanges = ts.textChanges || (ts.textChanges = {}));
9533995340})(ts || (ts = {}));
9534095341/* @internal */
@@ -102515,6 +102516,13 @@ var ts;
102515102516 : undefined;
102516102517 }
102517102518 server.findArgument = findArgument;
102519+ /*@internal*/
102520+ function nowString() {
102521+ // E.g. "12:34:56.789"
102522+ var d = new Date();
102523+ return d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "." + d.getMilliseconds();
102524+ }
102525+ server.nowString = nowString;
102518102526 })(server = ts.server || (ts.server = {}));
102519102527})(ts || (ts = {}));
102520102528/// <reference path="types.ts" />
@@ -108711,6 +108719,8 @@ var ts;
108711108719 }
108712108720 this.currentDirectory = this.host.getCurrentDirectory();
108713108721 this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
108722+ this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation &&
108723+ ts.ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation));
108714108724 this.throttledOperations = new server.ThrottledOperations(this.host, this.logger);
108715108725 if (this.typesMapLocation) {
108716108726 this.loadTypesMap();
@@ -108815,10 +108825,10 @@ var ts;
108815108825 else {
108816108826 if (_this.pendingEnsureProjectForOpenFiles) {
108817108827 _this.ensureProjectForOpenFiles();
108828+ // Send the event to notify that there were background project updates
108829+ // send current list of open files
108830+ _this.sendProjectsUpdatedInBackgroundEvent();
108818108831 }
108819- // Send the event to notify that there were background project updates
108820- // send current list of open files
108821- _this.sendProjectsUpdatedInBackgroundEvent();
108822108832 }
108823108833 });
108824108834 };
@@ -108901,7 +108911,6 @@ var ts;
108901108911 return undefined;
108902108912 }
108903108913 if (server.isInferredProjectName(projectName)) {
108904- this.ensureProjectStructuresUptoDate();
108905108914 return findProjectByName(projectName, this.inferredProjects);
108906108915 }
108907108916 return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName));
@@ -109848,7 +109857,10 @@ var ts;
109848109857 var _this = this;
109849109858 ts.Debug.assert(!info.fileWatcher);
109850109859 // do not watch files with mixed content - server doesn't know how to interpret it
109851- if (!info.isDynamicOrHasMixedContent()) {
109860+ // do not watch files in the global cache location
109861+ if (!info.isDynamicOrHasMixedContent() &&
109862+ (!this.globalCacheLocationDirectoryPath ||
109863+ !ts.startsWith(info.path, this.globalCacheLocationDirectoryPath))) {
109852109864 var fileName = info.fileName;
109853109865 info.fileWatcher = this.watchFactory.watchFilePath(this.host, fileName, function (fileName, eventKind, path) { return _this.onSourceFileChanged(fileName, eventKind, path); }, ts.PollingInterval.Medium, info.path, "Closed Script info" /* ClosedScriptInfo */);
109854109866 }
0 commit comments