mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add output channel for SQL Bindings extension (#20336)
* add output channel for SQL Bindings extension * add output channel to open once added
This commit is contained in:
@@ -25,6 +25,8 @@ export interface ILocalSettingsJson {
|
|||||||
ConnectionStrings?: { [key: string]: string };
|
ConnectionStrings?: { [key: string]: string };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const outputChannel = vscode.window.createOutputChannel(constants.serviceName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* copied and modified from vscode-azurefunctions extension
|
* copied and modified from vscode-azurefunctions extension
|
||||||
* https://github.com/microsoft/vscode-azurefunctions/blob/main/src/funcConfig/local.settings.ts
|
* https://github.com/microsoft/vscode-azurefunctions/blob/main/src/funcConfig/local.settings.ts
|
||||||
@@ -198,7 +200,11 @@ export async function getSettingsFile(projectFolder: string): Promise<string | u
|
|||||||
* @param selectedProjectFile is the users selected project file path
|
* @param selectedProjectFile is the users selected project file path
|
||||||
*/
|
*/
|
||||||
export async function addSqlNugetReferenceToProjectFile(selectedProjectFile: string): Promise<void> {
|
export async function addSqlNugetReferenceToProjectFile(selectedProjectFile: string): Promise<void> {
|
||||||
await utils.executeCommand(`dotnet add "${selectedProjectFile}" package ${constants.sqlExtensionPackageName} --prerelease`);
|
// clear the output channel prior to adding the nuget reference
|
||||||
|
outputChannel.clear();
|
||||||
|
let addNugetCommmand = await utils.executeCommand(`dotnet add "${selectedProjectFile}" package ${constants.sqlExtensionPackageName} --prerelease`);
|
||||||
|
outputChannel.appendLine(constants.dotnetResult(addNugetCommmand));
|
||||||
|
outputChannel.show(true);
|
||||||
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ export const sqlBindingsHelpLink = 'https://github.com/Azure/azure-functions-sql
|
|||||||
export const passwordPlaceholder = '******';
|
export const passwordPlaceholder = '******';
|
||||||
export const azureFunctionLocalSettingsFileName = 'local.settings.json';
|
export const azureFunctionLocalSettingsFileName = 'local.settings.json';
|
||||||
export const vscodeOpenCommand = 'vscode.open';
|
export const vscodeOpenCommand = 'vscode.open';
|
||||||
|
export const serviceName = 'SQL Bindings';
|
||||||
|
|
||||||
// localized constants
|
// localized constants
|
||||||
export const functionNameTitle = localize('functionNameTitle', 'Function Name');
|
export const functionNameTitle = localize('functionNameTitle', 'Function Name');
|
||||||
@@ -90,6 +91,7 @@ export function failedToParse(filename: string, error: any): string { return loc
|
|||||||
export function addSqlBinding(functionName: string): string { return localize('addSqlBinding', 'Adding SQL Binding to function "{0}"...'), functionName; }
|
export function addSqlBinding(functionName: string): string { return localize('addSqlBinding', 'Adding SQL Binding to function "{0}"...'), functionName; }
|
||||||
export function errorNewAzureFunction(error: any): string { return localize('errorNewAzureFunction', 'Error creating new Azure Function: {0}', utils.getErrorMessage(error)); }
|
export function errorNewAzureFunction(error: any): string { return localize('errorNewAzureFunction', 'Error creating new Azure Function: {0}', utils.getErrorMessage(error)); }
|
||||||
export function manuallyEnterObjectName(userObjectName: string): string { return `$(pencil) ${userObjectName}`; }
|
export function manuallyEnterObjectName(userObjectName: string): string { return `$(pencil) ${userObjectName}`; }
|
||||||
|
export function dotnetResult(output: string): string { return localize('dotnetResult', 'Adding SQL nuget package:\n{0}', output); }
|
||||||
|
|
||||||
// Known Azure settings reference for Azure Functions
|
// Known Azure settings reference for Azure Functions
|
||||||
// https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings
|
// https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings
|
||||||
|
|||||||
Reference in New Issue
Block a user