mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
Fixes issues with SQL Bindings vscode dev (#18695)
* fixes issues with vscode development
This commit is contained in:
@@ -2,14 +2,13 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as vscode from 'vscode';
|
||||
import AdsTelemetryReporter from '@microsoft/ads-extension-telemetry';
|
||||
import { getPackageInfo } from './utils';
|
||||
|
||||
const packageInfo = vscode.extensions.getExtension('Microsoft.sql-bindings')?.packageJSON;
|
||||
const packageInfo = getPackageInfo()!;
|
||||
|
||||
export const TelemetryReporter = new AdsTelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
|
||||
|
||||
|
||||
export enum TelemetryViews {
|
||||
SqlBindingsQuickPick = 'SqlBindingsQuickPick'
|
||||
}
|
||||
|
||||
@@ -108,3 +108,17 @@ export async function getAllProjectsInFolder(folder: vscode.Uri, projectExtensio
|
||||
// glob will return an array of file paths with forward slashes, so they need to be converted back if on windows
|
||||
return (await glob(projFilter)).map(p => vscode.Uri.file(path.resolve(p)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the package info for the extension based on where the extension is installed
|
||||
* @returns the package info object
|
||||
*/
|
||||
export function getPackageInfo(): IPackageInfo {
|
||||
const packageJson = require('../../package.json');
|
||||
return {
|
||||
name: packageJson.name,
|
||||
fullName: `${packageJson.publisher}.${packageJson.name}`,
|
||||
version: packageJson.version,
|
||||
aiKey: packageJson.aiKey
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as vscode from 'vscode';
|
||||
import { getAzdataApi } from './common/utils';
|
||||
import { launchAddSqlBindingQuickpick } from '../src/dialogs/addSqlBindingQuickpick';
|
||||
import { launchAddSqlBindingQuickpick } from './dialogs/addSqlBindingQuickpick';
|
||||
|
||||
export function activate(context: vscode.ExtensionContext): void {
|
||||
void vscode.commands.executeCommand('setContext', 'azdataAvailable', !!getAzdataApi());
|
||||
|
||||
Reference in New Issue
Block a user