@@ -19479,10 +19479,12 @@ var ts;
19479
19479
if (subsequentNode.kind === node.kind) {
19480
19480
var errorNode_1 = subsequentNode.name || subsequentNode;
19481
19481
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
+ }
19486
19488
return;
19487
19489
}
19488
19490
else if (ts.nodeIsPresent(subsequentNode.body)) {
@@ -41443,7 +41445,7 @@ var ts;
41443
41445
},
41444
41446
_a[CommandNames.Open] = function (request) {
41445
41447
var openArgs = request.arguments;
41446
- _this.openClientFile(openArgs.file);
41448
+ _this.openClientFile(openArgs.file, openArgs.fileContent );
41447
41449
return { responseRequired: false };
41448
41450
},
41449
41451
_a[CommandNames.Quickinfo] = function (request) {
@@ -41876,9 +41878,9 @@ var ts;
41876
41878
symbolDisplayString: displayString
41877
41879
};
41878
41880
};
41879
- Session.prototype.openClientFile = function (fileName) {
41881
+ Session.prototype.openClientFile = function (fileName, fileContent ) {
41880
41882
var file = ts.normalizePath(fileName);
41881
- this.projectService.openClientFile(file);
41883
+ this.projectService.openClientFile(file, fileContent );
41882
41884
};
41883
41885
Session.prototype.getQuickInfo = function (line, offset, fileName) {
41884
41886
var file = ts.normalizePath(fileName);
@@ -43031,14 +43033,14 @@ var ts;
43031
43033
filename = ts.normalizePath(filename);
43032
43034
return ts.lookUp(this.filenameToScriptInfo, filename);
43033
43035
};
43034
- ProjectService.prototype.openFile = function (fileName, openedByClient) {
43036
+ ProjectService.prototype.openFile = function (fileName, openedByClient, fileContent ) {
43035
43037
var _this = this;
43036
43038
fileName = ts.normalizePath(fileName);
43037
43039
var info = ts.lookUp(this.filenameToScriptInfo, fileName);
43038
43040
if (!info) {
43039
43041
var content;
43040
43042
if (this.host.fileExists(fileName)) {
43041
- content = this.host.readFile(fileName);
43043
+ content = fileContent || this.host.readFile(fileName);
43042
43044
}
43043
43045
if (!content) {
43044
43046
if (openedByClient) {
@@ -43056,6 +43058,9 @@ var ts;
43056
43058
}
43057
43059
}
43058
43060
if (info) {
43061
+ if (fileContent) {
43062
+ info.svc.reload(fileContent);
43063
+ }
43059
43064
if (openedByClient) {
43060
43065
info.isOpen = true;
43061
43066
}
@@ -43076,9 +43081,9 @@ var ts;
43076
43081
}
43077
43082
return undefined;
43078
43083
};
43079
- ProjectService.prototype.openClientFile = function (fileName) {
43084
+ ProjectService.prototype.openClientFile = function (fileName, fileContent ) {
43080
43085
this.openOrUpdateConfiguredProjectForFile(fileName);
43081
- var info = this.openFile(fileName, true);
43086
+ var info = this.openFile(fileName, true, fileContent );
43082
43087
this.addOpenFile(info);
43083
43088
this.printProjects();
43084
43089
return info;
0 commit comments