mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-22 11:01:37 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe63123066 | ||
|
|
09915fe557 | ||
|
|
79f6382267 | ||
|
|
8e0754dc46 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "azuredatastudio",
|
||||
"version": "1.20.0",
|
||||
"distro": "1cbfc86b4d9fe276817c369668b425e26494bb9e",
|
||||
"version": "1.20.1",
|
||||
"distro": "ddedf8820c8e88165bf0c23e1e4bb52bca4b4724",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
||||
@@ -74,9 +74,10 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
||||
const data = dragAndDropData.getData();
|
||||
const element = data[0];
|
||||
if (element.nodeTypeId === 'Column' || element.nodeTypeId === 'Table') {
|
||||
const schema = element.metadata.schema;
|
||||
const name = element.metadata.name;
|
||||
originalEvent.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify([`${element.nodeTypeId}:${element.id}?${schema ? schema + '.' + name : name}`]));
|
||||
const escapedSchema = element.metadata.schema?.replace(/]/g, ']]');
|
||||
const escapedName = element.metadata.name?.replace(/]/g, ']]');
|
||||
const finalString = escapedSchema ? `[${escapedSchema}].[${escapedName}]` : `[${escapedName}]`;
|
||||
originalEvent.dataTransfer.setData(DataTransfers.RESOURCES, JSON.stringify([`${element.nodeTypeId}:${element.id}?${finalString}`]));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@ export class ContextView extends Disposable {
|
||||
this.view.className = 'context-view';
|
||||
this.view.style.top = '0px';
|
||||
this.view.style.left = '0px';
|
||||
this.view.style.position = this.useFixedPosition ? 'fixed' : 'absolute';
|
||||
DOM.show(this.view);
|
||||
|
||||
// Render content
|
||||
|
||||
@@ -447,7 +447,7 @@ export class SuggestModel implements IDisposable {
|
||||
}
|
||||
|
||||
let clipboardText: string | undefined;
|
||||
if (completions.needsClipboard) {
|
||||
if (completions.needsClipboard || isNonEmptyArray(existingItems)) {
|
||||
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 { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
|
||||
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 json from 'vs/base/common/json';
|
||||
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 {
|
||||
return isEqualOrParent(path, environmentService.untitledWorkspacesHome);
|
||||
return extUriBiasedIgnorePathCase.isEqualOrParent(path, environmentService.untitledWorkspacesHome);
|
||||
}
|
||||
|
||||
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 { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands';
|
||||
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 { equals, coalesce } from 'vs/base/common/arrays';
|
||||
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 {
|
||||
if (typeof tooltip === 'string') {
|
||||
return tooltip;
|
||||
} else if (tooltip === undefined) {
|
||||
return undefined;
|
||||
} else {
|
||||
if (MarkdownStringType.isMarkdownString(tooltip)) {
|
||||
checkProposedApiEnabled(this.extension);
|
||||
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
|
||||
|
||||
@@ -1271,6 +1271,13 @@ export class MarkdownString {
|
||||
this.value += '\n```\n';
|
||||
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
|
||||
|
||||
@@ -360,7 +360,7 @@ class DropOverlay extends Themable {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const editor = this.editorService.activeTextEditorControl as ICodeEditor;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,13 +73,16 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
|
||||
private async registerLogChannel(id: string, label: string, file: URI): Promise<void> {
|
||||
await whenProviderRegistered(file, this.fileService);
|
||||
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);
|
||||
if (exists) {
|
||||
watcher.dispose();
|
||||
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const watcher = this.fileService.watch(dirname(file));
|
||||
const disposable = this.fileService.onDidFilesChange(e => {
|
||||
if (e.contains(file, FileChangeType.ADDED) || e.contains(file, FileChangeType.UPDATED)) {
|
||||
watcher.dispose();
|
||||
|
||||
@@ -316,19 +316,14 @@ class InputRenderer implements ICompressibleTreeRenderer<ISCMInput, FuzzyScore,
|
||||
}
|
||||
};
|
||||
|
||||
const initialRender = () => {
|
||||
const startListeningContentHeightChange = () => {
|
||||
disposables.add(templateData.inputWidget.onDidChangeContentHeight(onDidChangeContentHeight));
|
||||
onDidChangeContentHeight();
|
||||
};
|
||||
|
||||
const contentHeight = templateData.inputWidget.getContentHeight();
|
||||
|
||||
if (contentHeight !== InputRenderer.DEFAULT_HEIGHT) {
|
||||
const timeout = setTimeout(initialRender, 0);
|
||||
disposables.add({ dispose: () => clearTimeout(timeout) });
|
||||
} else {
|
||||
initialRender();
|
||||
}
|
||||
// Setup height change listener on next tick
|
||||
const timeout = setTimeout(startListeningContentHeightChange, 0);
|
||||
disposables.add({ dispose: () => clearTimeout(timeout) });
|
||||
|
||||
// Layout the editor whenever the outer layout happens
|
||||
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 { ElectronWebviewBasedWebview } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
|
||||
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);
|
||||
|
||||
@@ -52,11 +54,14 @@ const PRIORITY = 100;
|
||||
|
||||
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
|
||||
command?.addImplementation(PRIORITY, accessor => {
|
||||
const webview = getActiveElectronBasedWebview(accessor);
|
||||
if (webview) {
|
||||
f(webview);
|
||||
return true;
|
||||
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') === 'native') {
|
||||
const webview = getActiveElectronBasedWebview(accessor);
|
||||
if (webview) {
|
||||
f(webview);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
||||
|
||||
private readonly systemExtensionsPromise: Promise<IScannedExtension[]>;
|
||||
private readonly staticExtensions: IScannedExtension[];
|
||||
private readonly extensionsResource: URI;
|
||||
private readonly extensionsResource: URI | undefined;
|
||||
private readonly userExtensionsResourceLimiter: Queue<IUserExtension[]>;
|
||||
|
||||
constructor(
|
||||
@@ -58,7 +58,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
||||
@IRequestService private readonly requestService: IRequestService,
|
||||
@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.systemExtensionsPromise = isWeb ? this.builtinExtensionsScannerService.scanBuiltinExtensions() : Promise.resolve([]);
|
||||
const staticExtensions = environmentService.options && Array.isArray(environmentService.options.staticExtensions) ? environmentService.options.staticExtensions : [];
|
||||
@@ -155,10 +155,13 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
||||
return null;
|
||||
}
|
||||
|
||||
private readUserExtensions(): Promise<IUserExtension[]> {
|
||||
private async readUserExtensions(): Promise<IUserExtension[]> {
|
||||
if (!this.extensionsResource) {
|
||||
return [];
|
||||
}
|
||||
return this.userExtensionsResourceLimiter.queue(async () => {
|
||||
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());
|
||||
return storedUserExtensions.map(e => ({
|
||||
identifier: e.identifier,
|
||||
@@ -174,6 +177,9 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
||||
}
|
||||
|
||||
private writeUserExtensions(userExtensions: IUserExtension[]): Promise<IUserExtension[]> {
|
||||
if (!this.extensionsResource) {
|
||||
throw new Error('unsupported');
|
||||
}
|
||||
return this.userExtensionsResourceLimiter.queue(async () => {
|
||||
const storedUserExtensions: IStoredUserExtension[] = userExtensions.map(e => ({
|
||||
identifier: e.identifier,
|
||||
@@ -183,7 +189,7 @@ export class WebExtensionsScannerService implements IWebExtensionsScannerService
|
||||
changelogUri: e.changelogUri?.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;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
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.colorThemeRegistry = new ThemeRegistry(extensionService, colorThemesExtPoint, ColorThemeData.fromExtensionTheme);
|
||||
|
||||
Reference in New Issue
Block a user