Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed Nov 20, 2015
1 parent d370ac8 commit a1ff917
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 25 deletions.
10 changes: 6 additions & 4 deletions lib/tsc.js
Expand Up @@ -19016,10 +19016,12 @@ var ts;
if (subsequentNode.kind === node.kind) {
var errorNode_1 = subsequentNode.name || subsequentNode;
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
ts.Debug.assert(node.kind === 143 || node.kind === 142);
ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128));
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
var reportError = (node.kind === 143 || node.kind === 142) &&
(node.flags & 128) !== (subsequentNode.flags & 128);
if (reportError) {
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
}
return;
}
else if (ts.nodeIsPresent(subsequentNode.body)) {
Expand Down
27 changes: 16 additions & 11 deletions lib/tsserver.js
Expand Up @@ -19479,10 +19479,12 @@ var ts;
if (subsequentNode.kind === node.kind) {
var errorNode_1 = subsequentNode.name || subsequentNode;
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
ts.Debug.assert(node.kind === 143 || node.kind === 142);
ts.Debug.assert((node.flags & 128) !== (subsequentNode.flags & 128));
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
var reportError = (node.kind === 143 || node.kind === 142) &&
(node.flags & 128) !== (subsequentNode.flags & 128);
if (reportError) {
var diagnostic = node.flags & 128 ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
}
return;
}
else if (ts.nodeIsPresent(subsequentNode.body)) {
Expand Down Expand Up @@ -41443,7 +41445,7 @@ var ts;
},
_a[CommandNames.Open] = function (request) {
var openArgs = request.arguments;
_this.openClientFile(openArgs.file);
_this.openClientFile(openArgs.file, openArgs.fileContent);
return { responseRequired: false };
},
_a[CommandNames.Quickinfo] = function (request) {
Expand Down Expand Up @@ -41876,9 +41878,9 @@ var ts;
symbolDisplayString: displayString
};
};
Session.prototype.openClientFile = function (fileName) {
Session.prototype.openClientFile = function (fileName, fileContent) {
var file = ts.normalizePath(fileName);
this.projectService.openClientFile(file);
this.projectService.openClientFile(file, fileContent);
};
Session.prototype.getQuickInfo = function (line, offset, fileName) {
var file = ts.normalizePath(fileName);
Expand Down Expand Up @@ -43031,14 +43033,14 @@ var ts;
filename = ts.normalizePath(filename);
return ts.lookUp(this.filenameToScriptInfo, filename);
};
ProjectService.prototype.openFile = function (fileName, openedByClient) {
ProjectService.prototype.openFile = function (fileName, openedByClient, fileContent) {
var _this = this;
fileName = ts.normalizePath(fileName);
var info = ts.lookUp(this.filenameToScriptInfo, fileName);
if (!info) {
var content;
if (this.host.fileExists(fileName)) {
content = this.host.readFile(fileName);
content = fileContent || this.host.readFile(fileName);
}
if (!content) {
if (openedByClient) {
Expand All @@ -43056,6 +43058,9 @@ var ts;
}
}
if (info) {
if (fileContent) {
info.svc.reload(fileContent);
}
if (openedByClient) {
info.isOpen = true;
}
Expand All @@ -43076,9 +43081,9 @@ var ts;
}
return undefined;
};
ProjectService.prototype.openClientFile = function (fileName) {
ProjectService.prototype.openClientFile = function (fileName, fileContent) {
this.openOrUpdateConfiguredProjectForFile(fileName);
var info = this.openFile(fileName, true);
var info = this.openFile(fileName, true, fileContent);
this.addOpenFile(info);
this.printProjects();
return info;
Expand Down
15 changes: 10 additions & 5 deletions lib/typescript.js
Expand Up @@ -23384,11 +23384,16 @@ var ts;
var errorNode_1 = subsequentNode.name || subsequentNode;
// TODO(jfreeman): These are methods, so handle computed name case
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
// the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members
ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */);
ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */));
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) &&
(node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */);
// we can get here in two cases
// 1. mixed static and instance class members
// 2. something with the same name was defined before the set of overloads that prevents them from merging
// here we'll report error only for the first case since for second we should already report error in binder
if (reportError) {
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
}
return;
}
else if (ts.nodeIsPresent(subsequentNode.body)) {
Expand Down
15 changes: 10 additions & 5 deletions lib/typescriptServices.js
Expand Up @@ -23384,11 +23384,16 @@ var ts;
var errorNode_1 = subsequentNode.name || subsequentNode;
// TODO(jfreeman): These are methods, so handle computed name case
if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {
// the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members
ts.Debug.assert(node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */);
ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */));
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
var reportError = (node.kind === 143 /* MethodDeclaration */ || node.kind === 142 /* MethodSignature */) &&
(node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */);
// we can get here in two cases
// 1. mixed static and instance class members
// 2. something with the same name was defined before the set of overloads that prevents them from merging
// here we'll report error only for the first case since for second we should already report error in binder
if (reportError) {
var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;
error(errorNode_1, diagnostic);
}
return;
}
else if (ts.nodeIsPresent(subsequentNode.body)) {
Expand Down

0 comments on commit a1ff917

Please sign in to comment.