mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix data workspace vscode telemetry (#19768)
* fix data workspace vscode extension telemetry extension name * remove unused fullName
This commit is contained in:
@@ -40,15 +40,23 @@ export interface IPackageInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getPackageInfo(packageJson: any): IPackageInfo | undefined {
|
export function getPackageInfo(packageJson: any): IPackageInfo | undefined {
|
||||||
if (packageJson) {
|
const vscodePackageJson = require('../../package.vscode.json');
|
||||||
|
const azdataApi = getAzdataApi();
|
||||||
|
|
||||||
|
if (!packageJson || !azdataApi && !vscodePackageJson) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
// When the extension is compiled and packaged, the content of package.json get copied here in the extension.js. This happens before the
|
||||||
|
// package.vscode.json values replace the corresponding values in the package.json for the data-workspace-vscode extension
|
||||||
|
// so we need to read these values directly from the package.vscode.json to get the correct extension and publisher names
|
||||||
|
const extensionName = azdataApi ? packageJson.name : vscodePackageJson.name;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: packageJson.name,
|
name: extensionName,
|
||||||
version: packageJson.version,
|
version: packageJson.version,
|
||||||
aiKey: packageJson.aiKey
|
aiKey: packageJson.aiKey
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to load the azdata API - but gracefully handle the failure in case we're running
|
// Try to load the azdata API - but gracefully handle the failure in case we're running
|
||||||
|
|||||||
@@ -342,7 +342,6 @@ export async function getDefaultPublishDeploymentOptions(project: Project): Prom
|
|||||||
|
|
||||||
export interface IPackageInfo {
|
export interface IPackageInfo {
|
||||||
name: string;
|
name: string;
|
||||||
fullName: string;
|
|
||||||
version: string;
|
version: string;
|
||||||
aiKey: string;
|
aiKey: string;
|
||||||
}
|
}
|
||||||
@@ -363,11 +362,9 @@ export function getPackageInfo(packageJson?: any): IPackageInfo | undefined {
|
|||||||
// package.vscode.json values replace the corresponding values in the package.json for the sql-database-projects-vscode extension
|
// package.vscode.json values replace the corresponding values in the package.json for the sql-database-projects-vscode extension
|
||||||
// so we need to read these values directly from the package.vscode.json to get the correct extension and publisher names
|
// so we need to read these values directly from the package.vscode.json to get the correct extension and publisher names
|
||||||
const extensionName = azdataApi ? packageJson.name : vscodePackageJson.name;
|
const extensionName = azdataApi ? packageJson.name : vscodePackageJson.name;
|
||||||
const publisher = azdataApi ? packageJson.publisher : vscodePackageJson.publisher;
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: extensionName,
|
name: extensionName,
|
||||||
fullName: `${publisher}.${extensionName}`,
|
|
||||||
version: packageJson.version,
|
version: packageJson.version,
|
||||||
aiKey: packageJson.aiKey
|
aiKey: packageJson.aiKey
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user