@@ -3648,10 +3648,6 @@ var ts;
3648
3648
return path;
3649
3649
}
3650
3650
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
- */
3655
3651
function ensureTrailingDirectorySeparator(path) {
3656
3652
if (path.charAt(path.length - 1) !== ts.directorySeparator) {
3657
3653
return path + ts.directorySeparator;
@@ -11497,6 +11493,10 @@ var ts;
11497
11493
|| kind === 251 /* MissingDeclaration */;
11498
11494
}
11499
11495
ts.isTypeElement = isTypeElement;
11496
+ function isClassOrTypeElement(node) {
11497
+ return isTypeElement(node) || isClassElement(node);
11498
+ }
11499
+ ts.isClassOrTypeElement = isClassOrTypeElement;
11500
11500
function isObjectLiteralElementLike(node) {
11501
11501
var kind = node.kind;
11502
11502
return kind === 268 /* PropertyAssignment */
@@ -94878,10 +94878,7 @@ var ts;
94878
94878
}
94879
94879
};
94880
94880
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)) {
94885
94882
// check if previous statement ends with semicolon
94886
94883
// if not - insert semicolon to preserve the code from changing the meaning due to ASI
94887
94884
if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) {
@@ -94901,7 +94898,7 @@ var ts;
94901
94898
if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) {
94902
94899
return { prefix: this.newLineCharacter, suffix: this.newLineCharacter };
94903
94900
}
94904
- else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement (node)) {
94901
+ else if (ts.isStatement(node) || ts.isClassOrTypeElement (node)) {
94905
94902
return { suffix: this.newLineCharacter };
94906
94903
}
94907
94904
else if (ts.isVariableDeclaration(node)) {
@@ -95335,6 +95332,10 @@ var ts;
95335
95332
}
95336
95333
}
95337
95334
}
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
+ }
95338
95339
})(textChanges = ts.textChanges || (ts.textChanges = {}));
95339
95340
})(ts || (ts = {}));
95340
95341
/* @internal */
@@ -102515,6 +102516,13 @@ var ts;
102515
102516
: undefined;
102516
102517
}
102517
102518
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;
102518
102526
})(server = ts.server || (ts.server = {}));
102519
102527
})(ts || (ts = {}));
102520
102528
/// <reference path="types.ts" />
@@ -108711,6 +108719,8 @@ var ts;
108711
108719
}
108712
108720
this.currentDirectory = this.host.getCurrentDirectory();
108713
108721
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
108722
+ this.globalCacheLocationDirectoryPath = this.typingsInstaller.globalTypingsCacheLocation &&
108723
+ ts.ensureTrailingDirectorySeparator(this.toPath(this.typingsInstaller.globalTypingsCacheLocation));
108714
108724
this.throttledOperations = new server.ThrottledOperations(this.host, this.logger);
108715
108725
if (this.typesMapLocation) {
108716
108726
this.loadTypesMap();
@@ -108815,10 +108825,10 @@ var ts;
108815
108825
else {
108816
108826
if (_this.pendingEnsureProjectForOpenFiles) {
108817
108827
_this.ensureProjectForOpenFiles();
108828
+ // Send the event to notify that there were background project updates
108829
+ // send current list of open files
108830
+ _this.sendProjectsUpdatedInBackgroundEvent();
108818
108831
}
108819
- // Send the event to notify that there were background project updates
108820
- // send current list of open files
108821
- _this.sendProjectsUpdatedInBackgroundEvent();
108822
108832
}
108823
108833
});
108824
108834
};
@@ -108901,7 +108911,6 @@ var ts;
108901
108911
return undefined;
108902
108912
}
108903
108913
if (server.isInferredProjectName(projectName)) {
108904
- this.ensureProjectStructuresUptoDate();
108905
108914
return findProjectByName(projectName, this.inferredProjects);
108906
108915
}
108907
108916
return this.findExternalProjectByProjectName(projectName) || this.findConfiguredProjectByProjectName(server.toNormalizedPath(projectName));
@@ -109848,7 +109857,10 @@ var ts;
109848
109857
var _this = this;
109849
109858
ts.Debug.assert(!info.fileWatcher);
109850
109859
// 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))) {
109852
109864
var fileName = info.fileName;
109853
109865
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 */);
109854
109866
}
0 commit comments