mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add icons for some quickpick items (#16939)
This commit is contained in:
24
extensions/data-workspace/.vscode/launch.json
vendored
Normal file
24
extensions/data-workspace/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
// Note for debugging the VS Code version of the extension, currently you will need to modify
|
||||||
|
// the package.json and manually copy over the values from package.vscode.json into package.json
|
||||||
|
// (otherwise you'll get errors since other extensions depend on an extension with the name
|
||||||
|
// data-workspace-vscode, not data-workspace)
|
||||||
|
{
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Extension",
|
||||||
|
"runtimeExecutable": "${execPath}",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -42,42 +42,49 @@ export async function createNewProjectWithQuickpick(workspaceService: WorkspaceS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Prompt for Project location
|
const defaultProjectSaveLoc = defaultProjectSaveLocation();
|
||||||
// Show quick pick with just browse option to give user context about what the file dialog is for (since that doesn't always have a title)
|
const browseProjectLocationOptions = [constants.BrowseEllipsisWithIcon];
|
||||||
const browseProjectLocation = await vscode.window.showQuickPick(
|
if (defaultProjectSaveLoc) {
|
||||||
[constants.BrowseEllipsisWithIcon],
|
browseProjectLocationOptions.unshift(defaultProjectSaveLoc.fsPath);
|
||||||
{ title: constants.SelectProjectLocation, ignoreFocusOut: true });
|
|
||||||
if (!browseProjectLocation) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
// 3. Prompt for Project location
|
||||||
// We validate that the folder doesn't already exist, and if it does keep prompting them to pick a new one
|
// We validate that the folder doesn't already exist, and if it does keep prompting them to pick a new one
|
||||||
let valid = false;
|
|
||||||
let projectLocation = '';
|
let projectLocation = '';
|
||||||
while (!valid) {
|
let browseProjectLocationTitle = constants.SelectProjectLocation;
|
||||||
|
while (true) {
|
||||||
|
const browseProjectLocation = await vscode.window.showQuickPick(
|
||||||
|
browseProjectLocationOptions,
|
||||||
|
{ title: browseProjectLocationTitle, ignoreFocusOut: true });
|
||||||
|
if (!browseProjectLocation) {
|
||||||
|
// User cancelled
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (browseProjectLocation === constants.BrowseEllipsisWithIcon) {
|
||||||
const locations = await vscode.window.showOpenDialog({
|
const locations = await vscode.window.showOpenDialog({
|
||||||
canSelectFiles: false,
|
canSelectFiles: false,
|
||||||
canSelectFolders: true,
|
canSelectFolders: true,
|
||||||
canSelectMany: false,
|
canSelectMany: false,
|
||||||
openLabel: constants.Select,
|
openLabel: constants.Select,
|
||||||
title: constants.SelectProjectLocation,
|
title: constants.SelectProjectLocation,
|
||||||
defaultUri: defaultProjectSaveLocation()
|
defaultUri: defaultProjectSaveLoc
|
||||||
});
|
});
|
||||||
if (!locations) {
|
if (!locations) {
|
||||||
return;
|
// User cancelled out of open dialog - let them choose location again
|
||||||
|
browseProjectLocationTitle = constants.SelectProjectLocation;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
projectLocation = locations[0].fsPath;
|
projectLocation = locations[0].fsPath;
|
||||||
const exists = await directoryExist(path.join(projectLocation, projectName));
|
|
||||||
if (exists) {
|
|
||||||
// Show the browse quick pick again with the title updated with the error
|
|
||||||
const browseProjectLocation = await vscode.window.showQuickPick(
|
|
||||||
[constants.BrowseEllipsisWithIcon],
|
|
||||||
{ title: constants.ProjectDirectoryAlreadyExistErrorShort(projectName), ignoreFocusOut: true });
|
|
||||||
if (!browseProjectLocation) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
valid = true;
|
projectLocation = browseProjectLocation;
|
||||||
}
|
}
|
||||||
|
const locationExists = await directoryExist(path.join(projectLocation, projectName));
|
||||||
|
if (!locationExists) {
|
||||||
|
// Have a valid location so exit out now
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Otherwise show the browse quick pick again with the title updated with the error
|
||||||
|
browseProjectLocationTitle = constants.ProjectDirectoryAlreadyExistErrorShort(projectName);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
await workspaceService.createProject(projectName, vscode.Uri.file(projectLocation), projectType.id, undefined);
|
await workspaceService.createProject(projectName, vscode.Uri.file(projectLocation), projectType.id, undefined);
|
||||||
|
|||||||
24
extensions/sql-database-projects/.vscode/launch.json
vendored
Normal file
24
extensions/sql-database-projects/.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
// Note for debugging the VS Code version of the extension, currently you will need to modify
|
||||||
|
// the package.json and manually copy over the values from package.vscode.json into package.json
|
||||||
|
// (otherwise you'll get errors since other extensions depend on an extension with the name
|
||||||
|
// data-workspace-vscode, not data-workspace)
|
||||||
|
{
|
||||||
|
"type": "extensionHost",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Launch Extension",
|
||||||
|
"runtimeExecutable": "${execPath}",
|
||||||
|
"args": [
|
||||||
|
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||||
|
],
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceFolder}/out/**/*.js"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -115,6 +115,7 @@ export const selectProfileToUse = localize('selectProfileToUse', "Select publish
|
|||||||
export const selectProfile = localize('selectProfile', "Select Profile");
|
export const selectProfile = localize('selectProfile', "Select Profile");
|
||||||
export const dontUseProfile = localize('dontUseProfile', "Don't use profile");
|
export const dontUseProfile = localize('dontUseProfile', "Don't use profile");
|
||||||
export const browseForProfile = localize('browseForProfile', "Browse for profile");
|
export const browseForProfile = localize('browseForProfile', "Browse for profile");
|
||||||
|
export const browseForProfileWithIcon = `$(folder) ${browseForProfile}`;
|
||||||
export const chooseAction = localize('chooseAction', "Choose action");
|
export const chooseAction = localize('chooseAction', "Choose action");
|
||||||
export const chooseSqlcmdVarsToModify = localize('chooseSqlcmdVarsToModify', "Choose SQLCMD variables to modify");
|
export const chooseSqlcmdVarsToModify = localize('chooseSqlcmdVarsToModify', "Choose SQLCMD variables to modify");
|
||||||
export const enterNewValueForVar = (varName: string) => localize('enterNewValueForVar', "Enter new value for variable '{0}'", varName);
|
export const enterNewValueForVar = (varName: string) => localize('enterNewValueForVar', "Enter new value for variable '{0}'", varName);
|
||||||
|
|||||||
@@ -616,8 +616,9 @@ export class AddDatabaseReferenceDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getSystemDbOptions(project: Project): string[] {
|
export function getSystemDbOptions(project: Project): string[] {
|
||||||
|
const projectTargetVersion = project.getProjectTargetVersion().toLowerCase();
|
||||||
// only master is a valid system db reference for projects targeting Azure and DW
|
// only master is a valid system db reference for projects targeting Azure and DW
|
||||||
if (project.getProjectTargetVersion().toLowerCase().includes('azure') || project.getProjectTargetVersion().toLowerCase().includes('dw')) {
|
if (projectTargetVersion.includes('azure') || projectTargetVersion.includes('dw')) {
|
||||||
return [constants.master];
|
return [constants.master];
|
||||||
}
|
}
|
||||||
return [constants.master, constants.msdb];
|
return [constants.master, constants.msdb];
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
|
|||||||
// 1. Select publish settings file (optional)
|
// 1. Select publish settings file (optional)
|
||||||
// Create custom quickpick so we can control stuff like displaying the loading indicator
|
// Create custom quickpick so we can control stuff like displaying the loading indicator
|
||||||
const quickPick = vscode.window.createQuickPick();
|
const quickPick = vscode.window.createQuickPick();
|
||||||
quickPick.items = [{ label: constants.dontUseProfile }, { label: constants.browseForProfile }];
|
quickPick.items = [{ label: constants.dontUseProfile }, { label: constants.browseForProfileWithIcon }];
|
||||||
quickPick.ignoreFocusOut = true;
|
quickPick.ignoreFocusOut = true;
|
||||||
quickPick.title = constants.selectProfileToUse;
|
quickPick.title = constants.selectProfileToUse;
|
||||||
const profilePicked = new Promise<PublishProfile | undefined>((resolve, reject) => {
|
const profilePicked = new Promise<PublishProfile | undefined>((resolve, reject) => {
|
||||||
@@ -160,8 +160,8 @@ export async function getPublishDatabaseSettings(project: Project, promptForConn
|
|||||||
key: key
|
key: key
|
||||||
} as vscode.QuickPickItem & { key?: string, isResetAllVars?: boolean, isDone?: boolean };
|
} as vscode.QuickPickItem & { key?: string, isResetAllVars?: boolean, isDone?: boolean };
|
||||||
});
|
});
|
||||||
quickPickItems.push({ label: constants.resetAllVars, isResetAllVars: true });
|
quickPickItems.push({ label: `$(refresh) ${constants.resetAllVars}`, isResetAllVars: true });
|
||||||
quickPickItems.unshift({ label: constants.done, isDone: true });
|
quickPickItems.unshift({ label: `$(check) ${constants.done}`, isDone: true });
|
||||||
const sqlCmd = await vscode.window.showQuickPick(
|
const sqlCmd = await vscode.window.showQuickPick(
|
||||||
quickPickItems,
|
quickPickItems,
|
||||||
{ title: constants.chooseSqlcmdVarsToModify, ignoreFocusOut: true }
|
{ title: constants.chooseSqlcmdVarsToModify, ignoreFocusOut: true }
|
||||||
|
|||||||
Reference in New Issue
Block a user