Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/server/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,11 @@ namespace ts.server.protocol {
* true if install request succeeded, otherwise - false
*/
installSuccess: boolean;

/**
* version of typings installer
*/
typingsInstallerVersion: string;
}

export interface NavBarResponse extends Response {
Expand Down
3 changes: 2 additions & 1 deletion src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ namespace ts.server {
telemetryEventName: "typingsInstalled",
payload: {
installedPackages: response.packagesToInstall.join(","),
installSuccess: response.installSuccess
installSuccess: response.installSuccess,
typingsInstallerVersion: response.typingsInstallerVersion
}
};
const eventName: protocol.TelemetryEventName = "telemetry";
Expand Down
1 change: 1 addition & 0 deletions src/server/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ declare namespace ts.server {
readonly packagesToInstall: ReadonlyArray<string>;
readonly kind: EventInstall;
readonly installSuccess: boolean;
readonly typingsInstallerVersion: string;
}

export interface InstallTypingHost extends JsTyping.TypingResolutionHost {
Expand Down
7 changes: 5 additions & 2 deletions src/server/typingsInstaller/typingsInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/// <reference path="../shared.ts"/>

namespace ts.server.typingsInstaller {
const typingsInstallerVersion = "2.0.9";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move the ts.version to core and use it here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


interface NpmConfig {
devDependencies: MapLike<any>;
}
Expand Down Expand Up @@ -230,7 +232,7 @@ namespace ts.server.typingsInstaller {
}
const result: string[] = [];
for (const typing of typingsToInstall) {
if (this.missingTypingsSet[typing]) {
if (this.missingTypingsSet[typing] || this.packageNameToTypingLocation[typing]) {
continue;
}
const validationResult = validatePackageName(typing);
Expand Down Expand Up @@ -308,7 +310,8 @@ namespace ts.server.typingsInstaller {
this.sendResponse(<TypingsInstallEvent>{
kind: EventInstall,
packagesToInstall: scopedTypings,
installSuccess: ok
installSuccess: ok,
typingsInstallerVersion
});
}

Expand Down