mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-25 11:01:36 -05:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fdb2161d4 | ||
|
|
b2ca229e60 | ||
|
|
60037222a0 | ||
|
|
106bb5ecdf | ||
|
|
1bcbb93301 | ||
|
|
4fd2d9e76b | ||
|
|
b66031bf16 | ||
|
|
e001cb1da3 | ||
|
|
d70c9f2fa7 |
@@ -403,7 +403,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
|||||||
.withProps({
|
.withProps({
|
||||||
inputType: 'number',
|
inputType: 'number',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
placeHolder: '0'
|
value: '0'
|
||||||
})
|
})
|
||||||
.component();
|
.component();
|
||||||
this.retryIntervalBox = view.modelBuilder.inputBox()
|
this.retryIntervalBox = view.modelBuilder.inputBox()
|
||||||
@@ -411,7 +411,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
|
|||||||
.withProps({
|
.withProps({
|
||||||
inputType: 'number',
|
inputType: 'number',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
placeHolder: '0'
|
value: '0'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
let retryAttemptsContainer = view.modelBuilder.formContainer()
|
let retryAttemptsContainer = view.modelBuilder.formContainer()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "4.2.0.16",
|
"version": "4.2.1.5",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net6.0.zip",
|
"Windows_86": "win-x86-net6.0.zip",
|
||||||
"Windows_64": "win-x64-net6.0.zip",
|
"Windows_64": "win-x64-net6.0.zip",
|
||||||
|
|||||||
@@ -151,8 +151,10 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
if (pinStatusChanged) {
|
if (pinStatusChanged) {
|
||||||
// reset to original context value
|
// reset to original context value
|
||||||
bookTreeItem.contextValue = bookTreeItem.book.type === BookTreeItemType.Markdown ? BookTreeItemType.Markdown : getNotebookType(bookTreeItem.book);
|
bookTreeItem.contextValue = bookTreeItem.book.type === BookTreeItemType.Markdown ? BookTreeItemType.Markdown : getNotebookType(bookTreeItem.book);
|
||||||
|
// to search for notebook in allNotebooks dictionary we need to format uri
|
||||||
|
const notebookUri = vscode.Uri.file(bookTreeItem.book.contentPath).fsPath;
|
||||||
// if notebook is not in current book then it is a standalone notebook
|
// if notebook is not in current book then it is a standalone notebook
|
||||||
let itemOpenedInBookTreeView = this.currentBook?.getNotebook(bookTreeItem.book.contentPath) ?? this.books.find(book => book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(bookTreeItem.book.contentPath);
|
let itemOpenedInBookTreeView = this.currentBook?.getNotebook(notebookUri) ?? this.books.find(book => book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(notebookUri);
|
||||||
if (itemOpenedInBookTreeView) {
|
if (itemOpenedInBookTreeView) {
|
||||||
itemOpenedInBookTreeView.contextValue = bookTreeItem.contextValue;
|
itemOpenedInBookTreeView.contextValue = bookTreeItem.contextValue;
|
||||||
this._onDidChangeTreeData.fire(itemOpenedInBookTreeView.parent);
|
this._onDidChangeTreeData.fire(itemOpenedInBookTreeView.parent);
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -194,11 +196,15 @@ export async function getSettingsFile(projectFolder: string): Promise<string | u
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the required nuget package to the project
|
* Adds the latest SQL nuget package to the project
|
||||||
* @param selectedProjectFile is the users selected project file path
|
* @param projectFolder is the folder containing the project file
|
||||||
*/
|
*/
|
||||||
export async function addSqlNugetReferenceToProjectFile(selectedProjectFile: string): Promise<void> {
|
export async function addSqlNugetReferenceToProjectFile(projectFolder: 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 "${projectFolder}" package ${constants.sqlExtensionPackageName} --prerelease`);
|
||||||
|
outputChannel.appendLine(constants.dotnetResult(addNugetCommmand));
|
||||||
|
outputChannel.show(true);
|
||||||
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,8 +477,6 @@ export async function promptAndUpdateConnectionStringSetting(projectUri: vscode.
|
|||||||
connectionStringSettingName = selectedSetting?.label;
|
connectionStringSettingName = selectedSetting?.label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add sql extension package reference to project. If the reference is already there, it doesn't get added again
|
|
||||||
await addSqlNugetReferenceToProjectFile(projectUri.fsPath);
|
|
||||||
} else {
|
} else {
|
||||||
// if no AF project was found or there's more than one AF functions project in the workspace,
|
// if no AF project was found or there's more than one AF functions project in the workspace,
|
||||||
// ask for the user to input the setting name
|
// ask for the user to input the setting name
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import * as vscode from 'vscode';
|
|||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
import * as constants from '../common/constants';
|
import * as constants from '../common/constants';
|
||||||
import * as utils from '../common/utils';
|
import * as utils from '../common/utils';
|
||||||
|
import * as path from 'path';
|
||||||
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
|
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
|
||||||
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
|
||||||
import { addSqlBinding, getAzureFunctions } from '../services/azureFunctionsService';
|
import { addSqlBinding, getAzureFunctions } from '../services/azureFunctionsService';
|
||||||
@@ -113,6 +114,13 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined):
|
|||||||
.withAdditionalProperties(propertyBag).send();
|
.withAdditionalProperties(propertyBag).send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add latest sql extension package reference to project
|
||||||
|
// only add if AF project (.csproj) is found
|
||||||
|
if (projectUri?.fsPath) {
|
||||||
|
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(path.dirname(projectUri.fsPath));
|
||||||
|
}
|
||||||
|
|
||||||
exitReason = 'done';
|
exitReason = 'done';
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
|
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
|
||||||
.withAdditionalProperties(propertyBag).send();
|
.withAdditionalProperties(propertyBag).send();
|
||||||
|
|||||||
@@ -255,6 +255,10 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
|
|||||||
suppressCreateProjectPrompt: true,
|
suppressCreateProjectPrompt: true,
|
||||||
...(isCreateNewProject && { executeStep: connectionStringExecuteStep })
|
...(isCreateNewProject && { executeStep: connectionStringExecuteStep })
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add latest sql extension package reference to project
|
||||||
|
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(projectFolder);
|
||||||
|
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
|
||||||
.withAdditionalProperties(propertyBag)
|
.withAdditionalProperties(propertyBag)
|
||||||
.withConnectionInfo(connectionInfo).send();
|
.withConnectionInfo(connectionInfo).send();
|
||||||
|
|||||||
Reference in New Issue
Block a user