Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed Nov 11, 2016
1 parent 2dbbcc8 commit dcaad61
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 13 deletions.
4 changes: 4 additions & 0 deletions lib/protocol.d.ts
Expand Up @@ -1543,6 +1543,10 @@ declare namespace ts.server.protocol {
* Comma separated list of installed typing packages
*/
installedPackages: string;
/**
* true if install request succeeded, otherwise - false
*/
installSuccess: boolean;
}
interface NavBarResponse extends Response {
body?: NavigationBarItem[];
Expand Down
2 changes: 1 addition & 1 deletion lib/tsc.js
Expand Up @@ -37138,7 +37138,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.0.8";
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }
Expand Down
5 changes: 3 additions & 2 deletions lib/tsserver.js
Expand Up @@ -38553,7 +38553,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.0.8";
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }
Expand Down Expand Up @@ -56346,7 +56346,8 @@ var ts;
var body = {
telemetryEventName: "typingsInstalled",
payload: {
installedPackages: response.packagesToInstall.join(",")
installedPackages: response.packagesToInstall.join(","),
installSuccess: response.installSuccess
}
};
var eventName = "telemetry";
Expand Down
1 change: 1 addition & 0 deletions lib/tsserverlibrary.d.ts
Expand Up @@ -663,6 +663,7 @@ declare namespace ts.server.protocol {
}
interface TypingsInstalledTelemetryEventPayload {
installedPackages: string;
installSuccess: boolean;
}
interface NavBarResponse extends Response {
body?: NavigationBarItem[];
Expand Down
2 changes: 1 addition & 1 deletion lib/tsserverlibrary.js
Expand Up @@ -38553,7 +38553,7 @@ var ts;
})(ts || (ts = {}));
var ts;
(function (ts) {
ts.version = "2.0.8";
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }
Expand Down
2 changes: 1 addition & 1 deletion lib/typescript.js
Expand Up @@ -44687,7 +44687,7 @@ var ts;
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.8";
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }
Expand Down
2 changes: 1 addition & 1 deletion lib/typescriptServices.js
Expand Up @@ -44687,7 +44687,7 @@ var ts;
var ts;
(function (ts) {
/** The version of the TypeScript compiler release */
ts.version = "2.0.8";
ts.version = "2.0.9";
var emptyArray = [];
function findConfigFile(searchPath, fileExists, configName) {
if (configName === void 0) { configName = "tsconfig.json"; }
Expand Down
23 changes: 16 additions & 7 deletions lib/typingsInstaller.js
Expand Up @@ -5878,7 +5878,7 @@ var ts;
}
this.knownCachesSet[cacheLocation] = true;
};
TypingsInstaller.prototype.filterAndMapToScopedName = function (typingsToInstall) {
TypingsInstaller.prototype.filterTypings = function (typingsToInstall) {
if (typingsToInstall.length === 0) {
return typingsToInstall;
}
Expand All @@ -5891,7 +5891,7 @@ var ts;
var validationResult = validatePackageName(typing);
if (validationResult === PackageNameValidationResult.Ok) {
if (typing in this.typesRegistry) {
result.push("@types/" + typing);
result.push(typing);
}
else {
if (this.log.isEnabled()) {
Expand Down Expand Up @@ -5942,7 +5942,8 @@ var ts;
if (this.log.isEnabled()) {
this.log.writeLine("Installing typings " + JSON.stringify(typingsToInstall));
}
var scopedTypings = this.filterAndMapToScopedName(typingsToInstall);
var filteredTypings = this.filterTypings(typingsToInstall);
var scopedTypings = filteredTypings.map(function (x) { return ("@types/" + x); });
if (scopedTypings.length === 0) {
if (this.log.isEnabled()) {
this.log.writeLine("All typings are known to be missing or invalid - no need to go any further");
Expand All @@ -5956,18 +5957,26 @@ var ts;
if (_this.telemetryEnabled) {
_this.sendResponse({
kind: server.EventInstall,
packagesToInstall: scopedTypings
packagesToInstall: scopedTypings,
installSuccess: ok
});
}
if (!ok) {
if (_this.log.isEnabled()) {
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: " + JSON.stringify(filteredTypings));
}
for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
var typing = filteredTypings_1[_i];
_this.missingTypingsSet[typing] = true;
}
return;
}
if (_this.log.isEnabled()) {
_this.log.writeLine("Requested to install typings " + JSON.stringify(scopedTypings) + ", installed typings " + JSON.stringify(scopedTypings));
}
var installedTypingFiles = [];
for (var _i = 0, scopedTypings_1 = scopedTypings; _i < scopedTypings_1.length; _i++) {
var t = scopedTypings_1[_i];
for (var _a = 0, scopedTypings_1 = scopedTypings; _a < scopedTypings_1.length; _a++) {
var t = scopedTypings_1[_a];
var packageName = ts.getBaseFileName(t);
if (!packageName) {
continue;
Expand Down Expand Up @@ -6161,7 +6170,7 @@ var ts;
if (_this.log.isEnabled()) {
_this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms" + ts.sys.newLine + "stdout: " + stdout + ts.sys.newLine + "stderr: " + stderr);
}
onRequestCompleted(!!stdout);
onRequestCompleted(!err);
});
};
return NodeTypingsInstaller;
Expand Down

0 comments on commit dcaad61

Please sign in to comment.