Compare commits

...

4 Commits

Author SHA1 Message Date
Alan Ren
fe63123066 fix for dragged table name (#11376) (#11385)
* fix for dragged table name

* escaped bracket characters

* fixed escaping brackets

* moved outer brackets

* using interpolated strings

Co-authored-by: Christopher Suh <chsuh@microsoft.com>
2020-07-16 15:15:52 -07:00
Anthony Dresser
09915fe557 default theme to light (#11358) (#11384) 2020-07-16 14:55:03 -07:00
Anthony Dresser
79f6382267 Merge from vscode 17299e413d5590b14ab0340ea477cdd86ff13daf (#11357)
* Merge from vscode 17299e413d5590b14ab0340ea477cdd86ff13daf

* distro
2020-07-16 14:54:36 -07:00
Alan Ren
8e0754dc46 for hotfix (#11359) 2020-07-15 14:43:07 -07:00
13 changed files with 50 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "azuredatastudio",
"version": "1.20.0",
"distro": "1cbfc86b4d9fe276817c369668b425e26494bb9e",
"version": "1.20.1",
"distro": "ddedf8820c8e88165bf0c23e1e4bb52bca4b4724",
"author": {
"name": "Microsoft Corporation"
},

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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();

View File

@@ -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;
});
}

View File

@@ -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;
});
}

View File

@@ -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);