mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-27 02:51:36 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe63123066 | ||
|
|
09915fe557 | ||
|
|
79f6382267 | ||
|
|
8e0754dc46 |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "azuredatastudio",
|
"name": "azuredatastudio",
|
||||||
"version": "1.20.0",
|
"version": "1.20.1",
|
||||||
"distro": "1cbfc86b4d9fe276817c369668b425e26494bb9e",
|
"distro": "ddedf8820c8e88165bf0c23e1e4bb52bca4b4724",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Microsoft Corporation"
|
"name": "Microsoft Corporation"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,9 +74,10 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
|||||||
const data = dragAndDropData.getData();
|
const data = dragAndDropData.getData();
|
||||||
const element = data[0];
|
const element = data[0];
|
||||||
if (element.nodeTypeId === 'Column' || element.nodeTypeId === 'Table') {
|
if (element.nodeTypeId === 'Column' || element.nodeTypeId === 'Table') {
|
||||||
const schema = element.metadata.schema;
|
const escapedSchema = element.metadata.schema?.replace(/]/g, ']]');
|
||||||
const name = element.metadata.name;
|
const escapedName = element.metadata.name?.replace(/]/g, ']]');
|
||||||
originalEvent.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify([`${element.nodeTypeId}:${element.id}?${schema ? schema + '.' + name : name}`]));
|
const finalString = escapedSchema ? `[${escapedSchema}].[${escapedName}]` : `[${escapedName}]`;
|
||||||
|
originalEvent.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify([`${element.nodeTypeId}:${element.id}?${finalString}`]));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ export class ContextView extends Disposable {
|
|||||||
this.view.className = 'context-view';
|
this.view.className = 'context-view';
|
||||||
this.view.style.top = '0px';
|
this.view.style.top = '0px';
|
||||||
this.view.style.left = '0px';
|
this.view.style.left = '0px';
|
||||||
|
this.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';
|
||||||
DOM.show(this.view);
|
DOM.show(this.view);
|
||||||
|
|
||||||
// Render content
|
// Render content
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ export class SuggestModel implements IDisposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let clipboardText: string | undefined;
|
let clipboardText: string | undefined;
|
||||||
if (completions.needsClipboard) {
|
if (completions.needsClipboard || isNonEmptyArray(existingItems)) {
|
||||||
clipboardText = await this._clipboardService.readText();
|
clipboardText = await this._clipboardService.readText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { IWorkspaceFolder, IWorkspace } from 'vs/platform/workspace/common/works
|
|||||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||||
import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
|
import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
|
||||||
import { extname, isAbsolute } from 'vs/base/common/path';
|
import { extname, isAbsolute } from 'vs/base/common/path';
|
||||||
import { dirname, resolvePath, isEqualAuthority, isEqualOrParent, relativePath, extname as resourceExtname } from 'vs/base/common/resources';
|
import { dirname, resolvePath, isEqualAuthority, relativePath, extname as resourceExtname, extUriBiasedIgnorePathCase } from 'vs/base/common/resources';
|
||||||
import * as jsonEdit from 'vs/base/common/jsonEdit';
|
import * as jsonEdit from 'vs/base/common/jsonEdit';
|
||||||
import * as json from 'vs/base/common/json';
|
import * as json from 'vs/base/common/json';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
@@ -177,7 +177,7 @@ export function toWorkspaceIdentifier(workspace: IWorkspace): IWorkspaceIdentifi
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isUntitledWorkspace(path: URI, environmentService: IEnvironmentService): boolean {
|
export function isUntitledWorkspace(path: URI, environmentService: IEnvironmentService): boolean {
|
||||||
return isEqualOrParent(path, environmentService.untitledWorkspacesHome);
|
return extUriBiasedIgnorePathCase.isEqualOrParent(path, environmentService.untitledWorkspacesHome);
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IMultiFolderWorkspaceInitializationPayload = IWorkspaceIdentifier;
|
export type IMultiFolderWorkspaceInitializationPayload = IWorkspaceIdentifier;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.proto
|
|||||||
import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions } from 'vs/workbench/common/views';
|
import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions } from 'vs/workbench/common/views';
|
||||||
import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands';
|
import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands';
|
||||||
import { asPromise } from 'vs/base/common/async';
|
import { asPromise } from 'vs/base/common/async';
|
||||||
import { TreeItemCollapsibleState, ThemeIcon } from 'vs/workbench/api/common/extHostTypes';
|
import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType } from 'vs/workbench/api/common/extHostTypes';
|
||||||
import { isUndefinedOrNull, isString } from 'vs/base/common/types';
|
import { isUndefinedOrNull, isString } from 'vs/base/common/types';
|
||||||
import { equals, coalesce } from 'vs/base/common/arrays';
|
import { equals, coalesce } from 'vs/base/common/arrays';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
@@ -538,14 +538,11 @@ export class ExtHostTreeView<T> extends Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getTooltip(tooltip?: string | vscode.MarkdownString): string | IMarkdownString | undefined {
|
private getTooltip(tooltip?: string | vscode.MarkdownString): string | IMarkdownString | undefined {
|
||||||
if (typeof tooltip === 'string') {
|
if (MarkdownStringType.isMarkdownString(tooltip)) {
|
||||||
return tooltip;
|
|
||||||
} else if (tooltip === undefined) {
|
|
||||||
return undefined;
|
|
||||||
} else {
|
|
||||||
checkProposedApiEnabled(this.extension);
|
checkProposedApiEnabled(this.extension);
|
||||||
return MarkdownString.from(tooltip);
|
return MarkdownString.from(tooltip);
|
||||||
}
|
}
|
||||||
|
return tooltip;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected createTreeNode(element: T, extensionTreeItem: azdata.TreeItem2, parent: TreeNode | Root): TreeNode { // {{SQL CARBON EDIT}} change to protected, change to azdata.TreeItem
|
protected createTreeNode(element: T, extensionTreeItem: azdata.TreeItem2, parent: TreeNode | Root): TreeNode { // {{SQL CARBON EDIT}} change to protected, change to azdata.TreeItem
|
||||||
|
|||||||
@@ -1271,6 +1271,13 @@ export class MarkdownString {
|
|||||||
this.value += '\n```\n';
|
this.value += '\n```\n';
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isMarkdownString(thing: any): thing is vscode.MarkdownString {
|
||||||
|
if (thing instanceof MarkdownString) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return thing && thing.appendCodeblock && thing.appendMarkdown && thing.appendText && (thing.value !== undefined);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@es5ClassCompat
|
@es5ClassCompat
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ class DropOverlay extends Themable {
|
|||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
const editor = this.editorService.activeTextEditorControl as ICodeEditor;
|
const editor = this.editorService.activeTextEditorControl as ICodeEditor;
|
||||||
if (untitledOrFileResources[0].resource.scheme === 'Column' || untitledOrFileResources[0].resource.scheme === 'Table') {
|
if (untitledOrFileResources[0].resource.scheme === 'Column' || untitledOrFileResources[0].resource.scheme === 'Table') {
|
||||||
SnippetController2.get(editor).insert(`[${untitledOrFileResources[0].resource.query}]`);
|
SnippetController2.get(editor).insert(untitledOrFileResources[0].resource.query);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,13 +73,16 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
|
|||||||
private async registerLogChannel(id: string, label: string, file: URI): Promise<void> {
|
private async registerLogChannel(id: string, label: string, file: URI): Promise<void> {
|
||||||
await whenProviderRegistered(file, this.fileService);
|
await whenProviderRegistered(file, this.fileService);
|
||||||
const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
|
const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
|
||||||
|
|
||||||
|
/* watch first and then check if file exists so that to avoid missing file creation event after watching #102117 */
|
||||||
|
const watcher = this.fileService.watch(dirname(file));
|
||||||
const exists = await this.fileService.exists(file);
|
const exists = await this.fileService.exists(file);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
|
watcher.dispose();
|
||||||
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const watcher = this.fileService.watch(dirname(file));
|
|
||||||
const disposable = this.fileService.onDidFilesChange(e => {
|
const disposable = this.fileService.onDidFilesChange(e => {
|
||||||
if (e.contains(file, FileChangeType.ADDED) || e.contains(file, FileChangeType.UPDATED)) {
|
if (e.contains(file, FileChangeType.ADDED) || e.contains(file, FileChangeType.UPDATED)) {
|
||||||
watcher.dispose();
|
watcher.dispose();
|
||||||
|
|||||||
@@ -316,19 +316,14 @@ class InputRenderer implements ICompressibleTreeRenderer<ISCMInput, FuzzyScore,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialRender = () => {
|
const startListeningContentHeightChange = () => {
|
||||||
disposables.add(templateData.inputWidget.onDidChangeContentHeight(onDidChangeContentHeight));
|
disposables.add(templateData.inputWidget.onDidChangeContentHeight(onDidChangeContentHeight));
|
||||||
onDidChangeContentHeight();
|
onDidChangeContentHeight();
|
||||||
};
|
};
|
||||||
|
|
||||||
const contentHeight = templateData.inputWidget.getContentHeight();
|
// Setup height change listener on next tick
|
||||||
|
const timeout = setTimeout(startListeningContentHeightChange, 0);
|
||||||
if (contentHeight !== InputRenderer.DEFAULT_HEIGHT) {
|
disposables.add({ dispose: () => clearTimeout(timeout) });
|
||||||
const timeout = setTimeout(initialRender, 0);
|
|
||||||
disposables.add({ dispose: () => clearTimeout(timeout) });
|
|
||||||
} else {
|
|
||||||
initialRender();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Layout the editor whenever the outer layout happens
|
// Layout the editor whenever the outer layout happens
|
||||||
const layoutEditor = () => templateData.inputWidget.layout();
|
const layoutEditor = () => templateData.inputWidget.layout();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import { getActiveWebview } from 'vs/workbench/contrib/webview/browser/webviewCo
|
|||||||
import * as webviewCommands from 'vs/workbench/contrib/webview/electron-browser/webviewCommands';
|
import * as webviewCommands from 'vs/workbench/contrib/webview/electron-browser/webviewCommands';
|
||||||
import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
|
import { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
|
||||||
import { ElectronWebviewService } from 'vs/workbench/contrib/webview/electron-browser/webviewService';
|
import { ElectronWebviewService } from 'vs/workbench/contrib/webview/electron-browser/webviewService';
|
||||||
|
import { isMacintosh } from 'vs/base/common/platform';
|
||||||
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
|
|
||||||
registerSingleton(IWebviewService, ElectronWebviewService, true);
|
registerSingleton(IWebviewService, ElectronWebviewService, true);
|
||||||
|
|
||||||
@@ -52,11 +54,14 @@ const PRIORITY = 100;
|
|||||||
|
|
||||||
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
|
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
|
||||||
command?.addImplementation(PRIORITY, accessor => {
|
command?.addImplementation(PRIORITY, accessor => {
|
||||||
const webview = getActiveElectronBasedWebview(accessor);
|
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') === 'native') {
|
||||||
if (webview) {
|
const webview = getActiveElectronBasedWebview(accessor);
|
||||||
f(webview);
|
if (webview) {
|
||||||
return true;
|
f(webview);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
|||||||
|
|
||||||
private readonly systemExtensionsPromise: Promise<IScannedExtension[]>;
|
private readonly systemExtensionsPromise: Promise<IScannedExtension[]>;
|
||||||
private readonly staticExtensions: IScannedExtension[];
|
private readonly staticExtensions: IScannedExtension[];
|
||||||
private readonly extensionsResource: URI;
|
private readonly extensionsResource: URI | undefined;
|
||||||
private readonly userExtensionsResourceLimiter: Queue<IUserExtension[]>;
|
private readonly userExtensionsResourceLimiter: Queue<IUserExtension[]>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -58,7 +58,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
|||||||
@IRequestService private readonly requestService: IRequestService,
|
@IRequestService private readonly requestService: IRequestService,
|
||||||
@ILogService private readonly logService: ILogService,
|
@ILogService private readonly logService: ILogService,
|
||||||
) {
|
) {
|
||||||
this.extensionsResource = joinPath(environmentService.userRoamingDataHome, 'extensions.json');
|
this.extensionsResource = isWeb ? joinPath(environmentService.userRoamingDataHome, 'extensions.json') : undefined;
|
||||||
this.userExtensionsResourceLimiter = new Queue<IUserExtension[]>();
|
this.userExtensionsResourceLimiter = new Queue<IUserExtension[]>();
|
||||||
this.systemExtensionsPromise = isWeb ? this.builtinExtensionsScannerService.scanBuiltinExtensions() : Promise.resolve([]);
|
this.systemExtensionsPromise = isWeb ? this.builtinExtensionsScannerService.scanBuiltinExtensions() : Promise.resolve([]);
|
||||||
const staticExtensions = environmentService.options && Array.isArray(environmentService.options.staticExtensions) ? environmentService.options.staticExtensions : [];
|
const staticExtensions = environmentService.options && Array.isArray(environmentService.options.staticExtensions) ? environmentService.options.staticExtensions : [];
|
||||||
@@ -155,10 +155,13 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readUserExtensions(): Promise<IUserExtension[]> {
|
private async readUserExtensions(): Promise<IUserExtension[]> {
|
||||||
|
if (!this.extensionsResource) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return this.userExtensionsResourceLimiter.queue(async () => {
|
return this.userExtensionsResourceLimiter.queue(async () => {
|
||||||
try {
|
try {
|
||||||
const content = await this.fileService.readFile(this.extensionsResource);
|
const content = await this.fileService.readFile(this.extensionsResource!);
|
||||||
const storedUserExtensions: IStoredUserExtension[] = JSON.parse(content.value.toString());
|
const storedUserExtensions: IStoredUserExtension[] = JSON.parse(content.value.toString());
|
||||||
return storedUserExtensions.map(e => ({
|
return storedUserExtensions.map(e => ({
|
||||||
identifier: e.identifier,
|
identifier: e.identifier,
|
||||||
@@ -174,6 +177,9 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
|||||||
}
|
}
|
||||||
|
|
||||||
private writeUserExtensions(userExtensions: IUserExtension[]): Promise<IUserExtension[]> {
|
private writeUserExtensions(userExtensions: IUserExtension[]): Promise<IUserExtension[]> {
|
||||||
|
if (!this.extensionsResource) {
|
||||||
|
throw new Error('unsupported');
|
||||||
|
}
|
||||||
return this.userExtensionsResourceLimiter.queue(async () => {
|
return this.userExtensionsResourceLimiter.queue(async () => {
|
||||||
const storedUserExtensions: IStoredUserExtension[] = userExtensions.map(e => ({
|
const storedUserExtensions: IStoredUserExtension[] = userExtensions.map(e => ({
|
||||||
identifier: e.identifier,
|
identifier: e.identifier,
|
||||||
@@ -183,7 +189,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
|||||||
changelogUri: e.changelogUri?.toJSON(),
|
changelogUri: e.changelogUri?.toJSON(),
|
||||||
packageNLSUri: e.packageNLSUri?.toJSON(),
|
packageNLSUri: e.packageNLSUri?.toJSON(),
|
||||||
}));
|
}));
|
||||||
await this.fileService.writeFile(this.extensionsResource, VSBuffer.fromString(JSON.stringify(storedUserExtensions)));
|
await this.fileService.writeFile(this.extensionsResource!, VSBuffer.fromString(JSON.stringify(storedUserExtensions)));
|
||||||
return userExtensions;
|
return userExtensions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
|
|||||||
@ILogService private readonly logService: ILogService
|
@ILogService private readonly logService: ILogService
|
||||||
) {
|
) {
|
||||||
this.container = layoutService.container;
|
this.container = layoutService.container;
|
||||||
const defaultThemeType = environmentService.configuration.defaultThemeType || DARK;
|
const defaultThemeType = environmentService.configuration.defaultThemeType || LIGHT; // {{SQL CARBON EDIT}} default to light theme
|
||||||
this.settings = new ThemeConfiguration(configurationService, defaultThemeType);
|
this.settings = new ThemeConfiguration(configurationService, defaultThemeType);
|
||||||
|
|
||||||
this.colorThemeRegistry = new ThemeRegistry(extensionService, colorThemesExtPoint, ColorThemeData.fromExtensionTheme);
|
this.colorThemeRegistry = new ThemeRegistry(extensionService, colorThemesExtPoint, ColorThemeData.fromExtensionTheme);
|
||||||
|
|||||||
Reference in New Issue
Block a user