Skip to content

Commit a1ff917

Browse files
committed
Update LKG
1 parent d370ac8 commit a1ff917

File tree

4 files changed

+42
-25
lines changed

4 files changed

+42
-25
lines changed

lib/tsc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19016,10 +19016,12 @@ var ts;
1901619016
if (subsequentNode.kind === node.kind) {
1901719017
var errorNode_1 = subsequentNode.name || subsequentNode;
1901819018
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
19019-
ts.Debug.assert(node.kind === 143 || node.kind === 142);
19020-
ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128));
19021-
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
19022-
error(errorNode_1, diagnostic);
19019+
var reportError = (node.kind === 143 || node.kind === 142) &&
19020+
(node.flags & 128) !== (subsequentNode.flags & 128);
19021+
if (reportError) {
19022+
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
19023+
error(errorNode_1, diagnostic);
19024+
}
1902319025
return;
1902419026
}
1902519027
else if (ts.nodeIsPresent(subsequentNode.body)) {

lib/tsserver.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19479,10 +19479,12 @@ var ts;
1947919479
if (subsequentNode.kind === node.kind) {
1948019480
var errorNode_1 = subsequentNode.name || subsequentNode;
1948119481
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
19482-
ts.Debug.assert(node.kind === 143 || node.kind === 142);
19483-
ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128));
19484-
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
19485-
error(errorNode_1, diagnostic);
19482+
var reportError = (node.kind === 143 || node.kind === 142) &&
19483+
(node.flags & 128) !== (subsequentNode.flags & 128);
19484+
if (reportError) {
19485+
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
19486+
error(errorNode_1, diagnostic);
19487+
}
1948619488
return;
1948719489
}
1948819490
else if (ts.nodeIsPresent(subsequentNode.body)) {
@@ -41443,7 +41445,7 @@ var ts;
4144341445
},
4144441446
_a[CommandNames.Open] = function (request) {
4144541447
var openArgs = request.arguments;
41446-
_this.openClientFile(openArgs.file);
41448+
_this.openClientFile(openArgs.file, openArgs.fileContent);
4144741449
return { responseRequired: false };
4144841450
},
4144941451
_a[CommandNames.Quickinfo] = function (request) {
@@ -41876,9 +41878,9 @@ var ts;
4187641878
symbolDisplayString: displayString
4187741879
};
4187841880
};
41879-
Session.prototype.openClientFile = function (fileName) {
41881+
Session.prototype.openClientFile = function (fileName, fileContent) {
4188041882
var file = ts.normalizePath(fileName);
41881-
this.projectService.openClientFile(file);
41883+
this.projectService.openClientFile(file, fileContent);
4188241884
};
4188341885
Session.prototype.getQuickInfo = function (line, offset, fileName) {
4188441886
var file = ts.normalizePath(fileName);
@@ -43031,14 +43033,14 @@ var ts;
4303143033
filename = ts.normalizePath(filename);
4303243034
return ts.lookUp(this.filenameToScriptInfo, filename);
4303343035
};
43034-
ProjectService.prototype.openFile = function (fileName, openedByClient) {
43036+
ProjectService.prototype.openFile = function (fileName, openedByClient, fileContent) {
4303543037
var _this = this;
4303643038
fileName = ts.normalizePath(fileName);
4303743039
var info = ts.lookUp(this.filenameToScriptInfo, fileName);
4303843040
if (!info) {
4303943041
var content;
4304043042
if (this.host.fileExists(fileName)) {
43041-
content = this.host.readFile(fileName);
43043+
content = fileContent || this.host.readFile(fileName);
4304243044
}
4304343045
if (!content) {
4304443046
if (openedByClient) {
@@ -43056,6 +43058,9 @@ var ts;
4305643058
}
4305743059
}
4305843060
if (info) {
43061+
if (fileContent) {
43062+
info.svc.reload(fileContent);
43063+
}
4305943064
if (openedByClient) {
4306043065
info.isOpen = true;
4306143066
}
@@ -43076,9 +43081,9 @@ var ts;
4307643081
}
4307743082
return undefined;
4307843083
};
43079-
ProjectService.prototype.openClientFile = function (fileName) {
43084+
ProjectService.prototype.openClientFile = function (fileName, fileContent) {
4308043085
this.openOrUpdateConfiguredProjectForFile(fileName);
43081-
var info = this.openFile(fileName, true);
43086+
var info = this.openFile(fileName, true, fileContent);
4308243087
this.addOpenFile(info);
4308343088
this.printProjects();
4308443089
return info;

lib/typescript.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23384,11 +23384,16 @@ var ts;
2338423384
var errorNode_1 = subsequentNode.name || subsequentNode;
2338523385
// TODO(jfreeman): These are methods, so handle computed name case
2338623386
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
23387-
// the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members
23388-
ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */);
23389-
ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */));
23390-
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
23391-
error(errorNode_1, diagnostic);
23387+
var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) &&
23388+
(node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */);
23389+
// we can get here in two cases
23390+
// 1. mixed static and instance class members
23391+
// 2. something with the same name was defined before the set of overloads that prevents them from merging
23392+
// here we'll report error only for the first case since for second we should already report error in binder
23393+
if (reportError) {
23394+
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
23395+
error(errorNode_1, diagnostic);
23396+
}
2339223397
return;
2339323398
}
2339423399
else if (ts.nodeIsPresent(subsequentNode.body)) {

lib/typescriptServices.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23384,11 +23384,16 @@ var ts;
2338423384
var errorNode_1 = subsequentNode.name || subsequentNode;
2338523385
// TODO(jfreeman): These are methods, so handle computed name case
2338623386
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
23387-
// the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members
23388-
ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */);
23389-
ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */));
23390-
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
23391-
error(errorNode_1, diagnostic);
23387+
var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) &&
23388+
(node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */);
23389+
// we can get here in two cases
23390+
// 1. mixed static and instance class members
23391+
// 2. something with the same name was defined before the set of overloads that prevents them from merging
23392+
// here we'll report error only for the first case since for second we should already report error in binder
23393+
if (reportError) {
23394+
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
23395+
error(errorNode_1, diagnostic);
23396+
}
2339223397
return;
2339323398
}
2339423399
else if (ts.nodeIsPresent(subsequentNode.body)) {

0 commit comments

Comments
 (0)