mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 01:25:36 -05:00
Merge branch 'ads-master-vscode-2020-03-11T04-19-20'
This commit is contained in:
@@ -468,7 +468,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
const model = this._untitledEditorService.create({ untitledResource: uri, mode: 'notebook', initialValue: options.initialContent });
|
||||
fileInput = this._instantiationService.createInstance(UntitledTextEditorInput, model);
|
||||
} else {
|
||||
fileInput = this._editorService.createInput({ forceFile: true, resource: uri, mode: 'notebook' }) as FileEditorInput;
|
||||
fileInput = this._editorService.createEditorInput({ forceFile: true, resource: uri, mode: 'notebook' }) as FileEditorInput;
|
||||
}
|
||||
}
|
||||
let input: NotebookInput;
|
||||
|
||||
@@ -38,7 +38,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
|
||||
|
||||
public $connect(fileUri: string, connectionId: string): Thenable<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
let editors = this._editorService.visibleControls.filter(resource => {
|
||||
let editors = this._editorService.visibleEditorPanes.filter(resource => {
|
||||
return !!resource && resource.input.resource.toString() === fileUri;
|
||||
});
|
||||
let editor = editors && editors.length > 0 ? editors[0] : undefined;
|
||||
@@ -75,7 +75,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
|
||||
|
||||
public $connectWithProfile(fileUri: string, connection: azdata.connection.ConnectionProfile): Thenable<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
let editors = this._editorService.visibleControls.filter(resource => {
|
||||
let editors = this._editorService.visibleEditorPanes.filter(resource => {
|
||||
return !!resource && resource.input.resource.toString() === fileUri;
|
||||
});
|
||||
let editor = editors && editors.length > 0 ? editors[0] : undefined;
|
||||
@@ -97,7 +97,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
|
||||
}
|
||||
|
||||
public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void {
|
||||
let filteredEditors = this._editorService.visibleControls.filter(editor => editor.input.resource.toString() === fileUri);
|
||||
let filteredEditors = this._editorService.visibleEditorPanes.filter(editor => editor.input.resource.toString() === fileUri);
|
||||
if (filteredEditors && filteredEditors.length > 0) {
|
||||
let editor = filteredEditors[0];
|
||||
if (editor instanceof QueryEditor) {
|
||||
@@ -118,7 +118,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
|
||||
}
|
||||
|
||||
public $createQueryTab(fileUri: string, title: string, componentId: string): void {
|
||||
let editors = this._editorService.visibleControls.filter(resource => {
|
||||
let editors = this._editorService.visibleEditorPanes.filter(resource => {
|
||||
return !!resource && resource.input.resource.toString() === fileUri;
|
||||
});
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ import { localize } from 'vs/nls';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
import { IThemable } from 'vs/base/common/styler';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export enum MessageLevel {
|
||||
Error = 0,
|
||||
@@ -151,7 +151,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
private _title: string,
|
||||
private _name: string,
|
||||
private readonly _telemetryService: IAdsTelemetryService,
|
||||
protected readonly layoutService: IWorkbenchLayoutService,
|
||||
protected readonly layoutService: ILayoutService,
|
||||
protected readonly _clipboardService: IClipboardService,
|
||||
protected readonly _themeService: IThemeService,
|
||||
protected readonly logService: ILogService,
|
||||
@@ -181,7 +181,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
}
|
||||
|
||||
this._bodyContainer = DOM.$(`.${builderClass}`, { role: 'dialog', 'aria-label': this._title });
|
||||
const top = this.layoutService.getTitleBarOffset();
|
||||
const top = this.layoutService.offset?.top ?? 0;
|
||||
this._bodyContainer.style.top = `${top}px`;
|
||||
this._modalDialog = DOM.append(this._bodyContainer, DOM.$('.modal-dialog'));
|
||||
this._modalContent = DOM.append(this._modalDialog, DOM.$('.modal-content'));
|
||||
|
||||
@@ -27,9 +27,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
@@ -38,6 +37,7 @@ import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { ServiceOptionType } from 'sql/platform/connection/common/interfaces';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class CategoryView extends ViewPane {
|
||||
|
||||
@@ -98,7 +98,7 @@ export class OptionsDialog extends Modal {
|
||||
title: string,
|
||||
name: string,
|
||||
options: IOptionsDialogOptions,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@@ -123,8 +123,8 @@ export class OptionsDialog extends Modal {
|
||||
// Theme styler
|
||||
attachButtonStyler(okButton, this._themeService);
|
||||
attachButtonStyler(closeButton, this._themeService);
|
||||
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getTheme());
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getColorTheme());
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement) {
|
||||
@@ -142,7 +142,7 @@ export class OptionsDialog extends Modal {
|
||||
}
|
||||
|
||||
// Update theming that is specific to options dialog flyout body
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
let borderColor = theme.getColor(contrastBorder);
|
||||
let border = borderColor ? borderColor.toString() : null;
|
||||
if (this._dividerBuilder) {
|
||||
@@ -239,7 +239,7 @@ export class OptionsDialog extends Modal {
|
||||
this.fillInOptions(bodyContainer, serviceOptions);
|
||||
|
||||
let viewSize = this._optionCategoryPadding + serviceOptions.length * this._optionRowSize;
|
||||
let categoryView = this._instantiationService.createInstance(CategoryView, bodyContainer, viewSize, { title: category, ariaHeaderLabel: category, id: category });
|
||||
let categoryView = this._instantiationService.createInstance(CategoryView, bodyContainer, viewSize, { title: category, id: category });
|
||||
this.splitview.addView(categoryView, viewSize);
|
||||
categoryView.render();
|
||||
attachPanelStyler(categoryView, this._themeService);
|
||||
|
||||
@@ -11,13 +11,14 @@ import {
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
|
||||
import { ComponentWithIconBase } from 'sql/workbench/browser/modelComponents/componentWithIconBase';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export interface ActionDescriptor {
|
||||
label: string;
|
||||
|
||||
@@ -32,7 +32,7 @@ export default class CheckBoxComponent extends ComponentBase implements ICompone
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef, ) {
|
||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef,) {
|
||||
super(changeRef, el);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { ModelComponentWrapper } from 'sql/workbench/browser/modelComponents/mod
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as nls from 'vs/nls';
|
||||
import { EventType, addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { IKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { endsWith } from 'vs/base/common/strings';
|
||||
import { firstIndex } from 'vs/base/common/arrays';
|
||||
import { IComponentDescriptor, IComponent, IModelStore, IComponentEventArgs, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
||||
@@ -291,7 +291,7 @@ export abstract class ComponentBase extends Disposable implements IComponent, On
|
||||
(<HTMLElement>this._el.nativeElement).focus();
|
||||
}
|
||||
|
||||
protected onkeydown(domNode: HTMLElement, listener: (e: IKeyboardEvent) => void): void {
|
||||
protected onkeydown(domNode: HTMLElement, listener: (e: StandardKeyboardEvent) => void): void {
|
||||
this._register(addDisposableListener(domNode, EventType.KEY_DOWN, (e: KeyboardEvent) => listener(new StandardKeyboardEvent(e))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export abstract class ComponentWithIconBase extends ComponentBase {
|
||||
protected _iconPath: IUserFriendlyIcon;
|
||||
constructor(
|
||||
changeRef: ChangeDetectorRef,
|
||||
el: ElementRef, ) {
|
||||
el: ElementRef,) {
|
||||
super(changeRef, el);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export default class EditorComponent extends ComponentBase implements IComponent
|
||||
this._editor.create(this._el.nativeElement);
|
||||
this._editor.setVisible(true);
|
||||
let uri = this.createUri();
|
||||
this._editorInput = this.editorService.createInput({ forceUntitled: true, resource: uri, mode: 'plaintext' }) as UntitledTextEditorInput;
|
||||
this._editorInput = this.editorService.createEditorInput({ forceUntitled: true, resource: uri, mode: 'plaintext' }) as UntitledTextEditorInput;
|
||||
await this._editor.setInput(this._editorInput, undefined);
|
||||
const model = await this._editorInput.resolve();
|
||||
this._editorModel = model.textEditorModel;
|
||||
|
||||
@@ -19,7 +19,7 @@ import { memoize } from 'vs/base/common/decorators';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { LayoutRequestParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
import { IComponentDescriptor, IModelStore, IComponent } from 'sql/platform/dashboard/browser/interfaces';
|
||||
@@ -75,11 +75,11 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._register(this.themeService.onThemeChange(event => this.updateTheme(event)));
|
||||
this._register(this.themeService.onDidColorThemeChange(event => this.updateTheme(event)));
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.updateTheme(this.themeService.getTheme());
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
if (this.componentHost) {
|
||||
this.loadComponent();
|
||||
}
|
||||
@@ -148,7 +148,7 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
|
||||
el.style.position = 'relative';
|
||||
}
|
||||
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
// TODO handle theming appropriately
|
||||
let el = <HTMLElement>this._ref.nativeElement;
|
||||
let backgroundColor = theme.getColor(colors.editorBackground, true);
|
||||
|
||||
@@ -126,7 +126,7 @@ export class QueryTextEditor extends BaseTextEditor {
|
||||
return editorWidget.getScrollHeight();
|
||||
}
|
||||
|
||||
public setHeightToScrollHeight(configChanged?: boolean, isEditorCollapsed?: boolean, ) {
|
||||
public setHeightToScrollHeight(configChanged?: boolean, isEditorCollapsed?: boolean,) {
|
||||
let editorWidget = this.getControl() as ICodeEditor;
|
||||
let layoutInfo = editorWidget.getLayoutInfo();
|
||||
if (!this._scrollbarHeight) {
|
||||
|
||||
@@ -147,9 +147,9 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
});
|
||||
}));
|
||||
|
||||
this._table.grid.onKeyDown.subscribe((e: KeyboardEvent) => {
|
||||
this._table.grid.onKeyDown.subscribe((e: DOMEvent) => {
|
||||
if (this.moveFocusOutWithTab) {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
let event = new StandardKeyboardEvent(e as KeyboardEvent);
|
||||
if (event.equals(KeyMod.Shift | KeyCode.Tab)) {
|
||||
e.stopImmediatePropagation();
|
||||
(<HTMLElement>(<HTMLElement>this._inputContainer.nativeElement).previousElementSibling).focus();
|
||||
|
||||
@@ -138,7 +138,7 @@ export class TreeComponentRenderer extends Disposable implements IRenderer {
|
||||
* Render a element, given an object bag returned by the template
|
||||
*/
|
||||
public renderElement(tree: ITree, element: ITreeComponentItem, templateId: string, templateData: TreeDataTemplate): void {
|
||||
const icon = this.themeService.getTheme().type === LIGHT ? element.icon : element.iconDark;
|
||||
const icon = this.themeService.getColorTheme().type === LIGHT ? element.icon : element.iconDark;
|
||||
const iconUri = icon ? URI.revive(icon) : null;
|
||||
templateData.icon.style.backgroundImage = iconUri ? `url('${iconUri.toString(true)}')` : '';
|
||||
templateData.icon.style.backgroundRepeat = 'no-repeat';
|
||||
|
||||
@@ -20,8 +20,8 @@ const languageAssociationRegistry = Registry.as<ILanguageAssociationRegistry>(La
|
||||
*/
|
||||
export async function setMode(accessor: ServicesAccessor, modeSupport: IModeSupport, activeEditor: IEditorInput, language: string): Promise<void> {
|
||||
const editorService = accessor.get(IEditorService);
|
||||
const activeWidget = getCodeEditor(editorService.activeTextEditorWidget);
|
||||
const activeControl = editorService.activeControl;
|
||||
const activeWidget = getCodeEditor(editorService.activeTextEditorControl);
|
||||
const activeControl = editorService.activeEditorPane;
|
||||
const textModel = activeWidget.getModel();
|
||||
const oldLanguage = textModel.getLanguageIdentifier().language;
|
||||
if (language !== oldLanguage) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { dirname, basename } from 'vs/base/common/resources';
|
||||
import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { WorkbenchAsyncDataTree, TreeResourceNavigator } from 'vs/platform/list/browser/listService';
|
||||
import { WorkbenchAsyncDataTree, ResourceNavigator } from 'vs/platform/list/browser/listService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { editorFindMatchHighlight, editorFindMatchHighlightBorder, textLinkForeground, textCodeBlockBackground, focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
@@ -52,7 +52,7 @@ import { firstIndex } from 'vs/base/common/arrays';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
export class CustomTreeViewPanel extends ViewPane {
|
||||
export class CustomTreeViewPane extends ViewPane {
|
||||
|
||||
private treeView: ITreeView;
|
||||
|
||||
@@ -69,13 +69,14 @@ export class CustomTreeViewPanel extends ViewPane {
|
||||
@IThemeService protected themeService: IThemeService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
||||
super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
||||
const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id));
|
||||
this.treeView = treeView as ITreeView;
|
||||
this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this));
|
||||
this._register(this.treeView.onDidChangeTitle((newTitle) => this.updateTitle(newTitle)));
|
||||
this._register(toDisposable(() => this.treeView.setVisibility(false)));
|
||||
this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()));
|
||||
this._register(this.treeView.onDidChangeWelcomeState(() => this._onDidChangeViewWelcomeState.fire()));
|
||||
this.updateTreeVisibility();
|
||||
}
|
||||
|
||||
@@ -90,18 +91,14 @@ export class CustomTreeViewPanel extends ViewPane {
|
||||
}
|
||||
}
|
||||
|
||||
shouldShowWelcome(): boolean {
|
||||
return (this.treeView.dataProvider === undefined) && (this.treeView.message === undefined);
|
||||
}
|
||||
|
||||
layoutBody(height: number, width: number): void {
|
||||
this.treeView.layout(height, width);
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
return [...this.treeView.getPrimaryActions()];
|
||||
}
|
||||
|
||||
getSecondaryActions(): IAction[] {
|
||||
return [...this.treeView.getSecondaryActions()];
|
||||
}
|
||||
|
||||
getActionViewItem(action: IAction): IActionViewItem | undefined {
|
||||
return action instanceof MenuItemAction ? new ContextAwareMenuEntryActionViewItem(action, this.keybindingService, this.notificationService, this.contextMenuService) : undefined;
|
||||
}
|
||||
@@ -209,6 +206,9 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
private readonly _onDidChangeActions: Emitter<void> = this._register(new Emitter<void>());
|
||||
readonly onDidChangeActions: Event<void> = this._onDidChangeActions.event;
|
||||
|
||||
private readonly _onDidChangeWelcomeState: Emitter<void> = this._register(new Emitter<void>());
|
||||
readonly onDidChangeWelcomeState: Event<void> = this._onDidChangeWelcomeState.event;
|
||||
|
||||
private readonly _onDidChangeTitle: Emitter<string> = this._register(new Emitter<string>());
|
||||
readonly onDidChangeTitle: Event<string> = this._onDidChangeTitle.event;
|
||||
|
||||
@@ -232,7 +232,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
this.menus = this._register(instantiationService.createInstance(TitleMenus, this.id));
|
||||
this._register(this.menus.onDidChangeTitle(() => this._onDidChangeActions.fire()));
|
||||
this._register(this.themeService.onDidFileIconThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/));
|
||||
this._register(this.themeService.onThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/));
|
||||
this._register(this.themeService.onDidColorThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/));
|
||||
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('explorer.decorations')) {
|
||||
this.doRefresh([this.root]).catch(onUnexpectedError); /** soft refresh **/
|
||||
@@ -277,6 +277,8 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
this._dataProvider = null;
|
||||
this.updateMessage();
|
||||
}
|
||||
|
||||
this._onDidChangeWelcomeState.fire();
|
||||
}
|
||||
|
||||
private _message: string | undefined;
|
||||
@@ -287,6 +289,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
set message(message: string | undefined) {
|
||||
this._message = message;
|
||||
this.updateMessage();
|
||||
this._onDidChangeWelcomeState.fire();
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
@@ -448,7 +451,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
|
||||
}));
|
||||
this.tree.setInput(this.root).then(() => this.updateContentAreas());
|
||||
|
||||
const customTreeNavigator = new TreeResourceNavigator(this.tree);
|
||||
const customTreeNavigator = ResourceNavigator.createTreeResourceNavigator(this.tree, { openOnFocus: false, openOnSelection: false });
|
||||
this._register(customTreeNavigator);
|
||||
this._register(customTreeNavigator.onDidOpenResource(e => {
|
||||
if (!e.browserEvent) {
|
||||
@@ -809,7 +812,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
|
||||
const treeItemLabel: ITreeItemLabel | undefined = node.label ? node.label : resource ? { label: basename(resource) } : undefined;
|
||||
const description = isString(node.description) ? node.description : resource && node.description === true ? this.labelService.getUriLabel(dirname(resource), { relative: true }) : undefined;
|
||||
const label = treeItemLabel ? treeItemLabel.label : undefined;
|
||||
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
const iconUrl = icon ? URI.revive(icon) : null;
|
||||
const title = node.tooltip ? node.tooltip : resource ? undefined : label;
|
||||
const sqlIcon = node.sqlIcon;
|
||||
@@ -892,7 +895,7 @@ class Aligner extends Disposable {
|
||||
}
|
||||
|
||||
private hasIcon(node: ITreeItem): boolean {
|
||||
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
|
||||
if (icon) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
|
||||
// Description is shown beside the tab name in the combobox of open editors
|
||||
public getDescription(): string { return this._description; }
|
||||
public supportsSplitEditor(): boolean { return false; }
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<boolean> {
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
return this._text.revert(group, options);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { fileFiltersSet } from 'sql/workbench/services/restore/common/constants';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const BACKUP_SELECTOR: string = 'backup-component';
|
||||
|
||||
@@ -349,7 +349,7 @@ export class BackupComponent extends AngularDisposable {
|
||||
this.mediaDescriptionBox.disable();
|
||||
|
||||
this.registerListeners();
|
||||
this.updateTheme(this.themeService.getTheme());
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@@ -552,7 +552,7 @@ export class BackupComponent extends AngularDisposable {
|
||||
}
|
||||
|
||||
// Update theming that is specific to backup dialog
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
// set modal footer style
|
||||
let footerHtmlElement: HTMLElement = <HTMLElement>this.modalFooterElement.nativeElement;
|
||||
const backgroundColor = theme.getColor(SIDE_BAR_BACKGROUND);
|
||||
|
||||
@@ -16,10 +16,10 @@ import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/boots
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class BackupDialog extends Modal {
|
||||
private _body: HTMLElement;
|
||||
@@ -28,7 +28,7 @@ export class BackupDialog extends Modal {
|
||||
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { mixin } from 'sql/base/common/objects';
|
||||
import { localize } from 'vs/nls';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
import { IInsight, IPointDataSet, customMixin } from './interfaces';
|
||||
import { IInsightOptions, DataDirection, ChartType, LegendPosition, DataType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
@@ -53,14 +53,14 @@ export class Graph implements IInsight {
|
||||
public static readonly types = [ChartType.Bar, ChartType.Doughnut, ChartType.HorizontalBar, ChartType.Line, ChartType.Pie, ChartType.Scatter, ChartType.TimeSeries];
|
||||
public readonly types = Graph.types;
|
||||
|
||||
private _theme: ITheme;
|
||||
private _theme: IColorTheme;
|
||||
|
||||
constructor(
|
||||
container: HTMLElement, options: IInsightOptions = defaultOptions,
|
||||
@IThemeService themeService: IThemeService
|
||||
) {
|
||||
this._theme = themeService.getTheme();
|
||||
themeService.onThemeChange(e => {
|
||||
this._theme = themeService.getColorTheme();
|
||||
themeService.onDidColorThemeChange(e => {
|
||||
this._theme = e;
|
||||
this.data = this._data;
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ import { WebviewWidget } from 'sql/workbench/contrib/dashboard/browser/widgets/w
|
||||
|
||||
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { Action, IAction } from 'vs/base/common/actions';
|
||||
@@ -37,6 +37,7 @@ import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
const componentMap: { [x: string]: Type<IDashboardWidget> } = {
|
||||
'properties-widget': PropertiesWidgetComponent,
|
||||
|
||||
@@ -98,7 +98,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
|
||||
this._onMessageDisposable.dispose();
|
||||
}
|
||||
|
||||
this._webview = this.webviewService.createWebview(this.id,
|
||||
this._webview = this.webviewService.createWebviewElement(this.id,
|
||||
{},
|
||||
{
|
||||
allowScripts: true
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
import 'vs/css!./dashboardPanel';
|
||||
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import {
|
||||
TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_BORDER, TAB_INACTIVE_BACKGROUND,
|
||||
TAB_INACTIVE_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, TAB_BORDER, EDITOR_GROUP_BORDER
|
||||
} from 'vs/workbench/common/theme';
|
||||
import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
|
||||
// Title Active
|
||||
const tabActiveBackground = theme.getColor(TAB_ACTIVE_BACKGROUND);
|
||||
@@ -112,4 +112,4 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
}
|
||||
`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,10 +15,11 @@ import { RefreshWidgetAction, EditDashboardAction } from 'sql/workbench/contrib/
|
||||
import { DashboardPage } from 'sql/workbench/contrib/dashboard/browser/core/dashboardPage.component';
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
export const DASHBOARD_SELECTOR: string = 'dashboard-component';
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IPointDataSet } from 'sql/workbench/contrib/charts/browser/interfaces';
|
||||
import { IInsightsView, IInsightData } from 'sql/platform/dashboard/browser/insightRegistry';
|
||||
import { ChartType, LegendPosition } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
@@ -61,8 +61,8 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
}
|
||||
|
||||
init() {
|
||||
this._register(this.themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this.themeService.getTheme());
|
||||
this._register(this.themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
// Note: must use a boolean to not render the canvas until all properties such as the labels and chart type are set.
|
||||
// This is because chart.js doesn't auto-update anything other than dataset when re-rendering so defaults are used
|
||||
// hence it's easier to not render until ready
|
||||
@@ -96,7 +96,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
|
||||
return this._options;
|
||||
}
|
||||
|
||||
protected updateTheme(e: ITheme): void {
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
const backgroundColor = e.getColor(colors.editorBackground);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IChartConfig } from 'sql/workbench/contrib/dashboard/browser/widgets/in
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
|
||||
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { customMixin } from 'sql/workbench/contrib/charts/browser/interfaces';
|
||||
import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
@@ -127,7 +127,7 @@ export default class BarChart extends ChartInsight {
|
||||
super.setConfig(config);
|
||||
}
|
||||
|
||||
protected updateTheme(e: ITheme): void {
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
super.updateTheme(e);
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
/* VS imports */
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant, ICssStyleCollector, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { registerThemingParticipant, ICssStyleCollector, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
@@ -149,7 +149,7 @@ export class TasksWidget extends DashboardWidget implements IDashboardWidget, On
|
||||
return tile;
|
||||
}
|
||||
|
||||
private registerThemeing(theme: ITheme, collector: ICssStyleCollector) {
|
||||
private registerThemeing(theme: IColorTheme, collector: ICssStyleCollector) {
|
||||
const contrastBorder = theme.getColor(colors.contrastBorder);
|
||||
const sideBarColor = theme.getColor(themeColors.SIDE_BAR_BACKGROUND);
|
||||
if (contrastBorder) {
|
||||
|
||||
@@ -97,7 +97,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
this._onMessageDisposable.dispose();
|
||||
}
|
||||
|
||||
this._webview = this.webviewService.createWebview(this.id,
|
||||
this._webview = this.webviewService.createWebviewElement(this.id,
|
||||
{},
|
||||
{
|
||||
allowScripts: true,
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, opener, themeService, telemetryService);
|
||||
super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, opener, themeService, telemetryService);
|
||||
this._addServerAction = this.instantiationService.createInstance(AddServerAction,
|
||||
AddServerAction.ID,
|
||||
AddServerAction.LABEL);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { coalesce } from 'vs/base/common/arrays';
|
||||
|
||||
import { CustomTreeViewPanel, CustomTreeView } from 'sql/workbench/browser/parts/views/customView';
|
||||
import { CustomTreeViewPane, CustomTreeView } from 'sql/workbench/browser/parts/views/customView';
|
||||
import { VIEWLET_ID } from 'sql/workbench/contrib/dataExplorer/browser/dataExplorerViewlet';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
|
||||
@@ -106,7 +106,7 @@ export class DataExplorerContainerExtensionHandler implements IWorkbenchContribu
|
||||
const viewDescriptor = <ITreeViewDescriptor>{
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
ctorDescriptor: new SyncDescriptor(CustomTreeViewPanel),
|
||||
ctorDescriptor: new SyncDescriptor(CustomTreeViewPane),
|
||||
when: ContextKeyExpr.deserialize(item.when),
|
||||
canToggleVisibility: true,
|
||||
collapsed: this.showCollapsed(container),
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as strings from 'vs/base/common/strings';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
import { EditorOptions, EditorInput, IEditorControl, IEditor } from 'vs/workbench/common/editor';
|
||||
import { EditorOptions, EditorInput, IEditorControl, IEditorPane } from 'vs/workbench/common/editor';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -522,7 +522,7 @@ export class EditDataEditor extends BaseEditor {
|
||||
this._createEditor(<UntitledTextEditorInput>newInput.sql, this._sqlEditorContainer)
|
||||
]);
|
||||
};
|
||||
onEditorsCreated = (result: IEditor[]) => {
|
||||
onEditorsCreated = (result: IEditorPane[]) => {
|
||||
return Promise.all([
|
||||
this._onResultsEditorCreated(<EditDataResultsEditor>result[0], newInput.results, options),
|
||||
this._onSqlEditorCreated(<TextResourceEditor>result[1], newInput.sql, options)
|
||||
@@ -583,7 +583,7 @@ export class EditDataEditor extends BaseEditor {
|
||||
|
||||
this._createEditor(<EditDataResultsInput>input.results, this._resultsEditorContainer)
|
||||
.then(async result => {
|
||||
await this._onResultsEditorCreated(<EditDataResultsEditor>result, input.results, this.options);
|
||||
await this._onResultsEditorCreated(<EditDataResultsEditor>result, input.results, this._options);
|
||||
this.resultsEditorVisibility = true;
|
||||
this.hideQueryResultsView = false;
|
||||
this._doLayout(true);
|
||||
@@ -630,7 +630,7 @@ export class EditDataEditor extends BaseEditor {
|
||||
let visible = currentEditorIsVisible;
|
||||
if (!currentEditorIsVisible) {
|
||||
// Current editor is closing but still tracked as visible. Check if any other editor is visible
|
||||
const candidates = [...this._editorService.visibleControls].filter(e => {
|
||||
const candidates = [...this._editorService.visibleEditorPanes].filter(e => {
|
||||
if (e && e.getId) {
|
||||
return e.getId() === EditDataEditor.ID;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
|
||||
function runActionOnActiveResultsEditor(accessor: ServicesAccessor, eventName: string): void {
|
||||
let editorService = accessor.get(IEditorService);
|
||||
const candidates = [editorService.activeControl, ...editorService.visibleControls].filter(e => {
|
||||
const candidates = [editorService.activeEditorPane, ...editorService.visibleEditorPanes].filter(e => {
|
||||
if (e) {
|
||||
let id = e.getId();
|
||||
if (id === QueryEditor.ID || id === EditDataEditor.ID) {
|
||||
|
||||
@@ -197,6 +197,7 @@ class MockEditorService extends TestEditorService {
|
||||
class TestModeService implements IModeService {
|
||||
_serviceBrand: undefined;
|
||||
onDidCreateMode: Event<IMode>;
|
||||
onLanguagesMaybeChanged: Event<void>;
|
||||
|
||||
isRegisteredMode(mimetypeOrModeId: string): boolean {
|
||||
throw new Error('Method not implemented.');
|
||||
|
||||
@@ -27,12 +27,13 @@ import { IAction } from 'vs/base/common/actions';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
|
||||
import { escape } from 'sql/base/common/strings';
|
||||
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { tableBackground, cellBackground, cellBorderColor } from 'sql/platform/theme/common/colors';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import { find, fill } from 'vs/base/common/arrays';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
export const JOBSVIEW_SELECTOR: string = 'jobsview-component';
|
||||
|
||||
@@ -27,7 +27,7 @@ import { IAction } from 'vs/base/common/actions';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDashboardService } from 'sql/platform/dashboard/browser/dashboardService';
|
||||
import { escape } from 'sql/base/common/strings';
|
||||
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { tableBackground, cellBackground, cellBorderColor } from 'sql/platform/theme/common/colors';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
@@ -35,6 +35,7 @@ import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { find, fill } from 'vs/base/common/arrays';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
|
||||
export const NOTEBOOKSVIEW_SELECTOR: string = 'notebooksview-component';
|
||||
|
||||
@@ -67,7 +67,7 @@ export default class WebViewComponent extends ComponentBase implements IComponen
|
||||
}
|
||||
|
||||
private _createWebview(): void {
|
||||
this._webview = this.webviewService.createWebview(this.id,
|
||||
this._webview = this.webviewService.createWebviewElement(this.id,
|
||||
{},
|
||||
{
|
||||
allowScripts: true
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { RunCellAction, CellContext } from 'sql/workbench/contrib/notebook/browser/cellViews/codeActions';
|
||||
import { NotebookModel } from 'sql/workbench/services/notebook/browser/models/notebookModel';
|
||||
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
@@ -36,6 +36,7 @@ import { IEditorProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { SimpleProgressIndicator } from 'sql/workbench/services/progress/browser/simpleProgressIndicator';
|
||||
import { notebookConstants } from 'sql/workbench/services/notebook/browser/interfaces';
|
||||
import { tryMatchCellMagic } from 'sql/workbench/services/notebook/browser/utils';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const CODE_SELECTOR: string = 'code-component';
|
||||
const MARKDOWN_CLASS = 'markdown';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Event } from 'vs/base/common/event';
|
||||
import { nb } from 'azdata';
|
||||
import { ICellModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import * as outputProcessor from 'sql/workbench/contrib/notebook/browser/models/outputProcessor';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ComponentHostDirective } from 'sql/base/browser/componentHost.directive';
|
||||
import { Extensions, IMimeComponent, IMimeComponentRegistry } from 'sql/workbench/contrib/notebook/browser/outputs/mimeRegistry';
|
||||
@@ -53,7 +53,7 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this._register(this._themeService.onThemeChange(event => this.updateTheme(event)));
|
||||
this._register(this._themeService.onDidColorThemeChange(event => this.updateTheme(event)));
|
||||
this.loadComponent();
|
||||
this.layout();
|
||||
this._initialized = true;
|
||||
@@ -62,7 +62,7 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.updateTheme(this._themeService.getTheme());
|
||||
this.updateTheme(this._themeService.getColorTheme());
|
||||
}
|
||||
|
||||
ngOnChanges(changes: { [propKey: string]: SimpleChange }) {
|
||||
@@ -128,7 +128,7 @@ export class OutputComponent extends CellView implements OnInit, AfterViewInit {
|
||||
public hasError(): boolean {
|
||||
return !types.isUndefinedOrNull(this.errorText);
|
||||
}
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
let el = <HTMLElement>this._ref.nativeElement;
|
||||
let backgroundColor = theme.getColor(colors.editorBackground, true);
|
||||
let foregroundColor = theme.getColor(themeColors.SIDE_BAR_FOREGROUND, true);
|
||||
|
||||
@@ -8,8 +8,9 @@ import { OnInit, Component, Input, Inject, ElementRef, ViewChild, forwardRef, Ch
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { ICellModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const OUTPUT_AREA_SELECTOR: string = 'output-area-component';
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'vs/css!./media/highlight';
|
||||
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, OnChanges, SimpleChange, HostListener, ViewChildren, QueryList } from '@angular/core';
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
@@ -27,6 +27,7 @@ import { CellToggleMoreActions } from 'sql/workbench/contrib/notebook/browser/ce
|
||||
import { CodeComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/code.component';
|
||||
import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor';
|
||||
import { NotebookRange } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export const TEXT_SELECTOR: string = 'text-cell-component';
|
||||
const USER_SELECT_CLASS = 'actionselect';
|
||||
|
||||
@@ -231,7 +231,7 @@ export abstract class NotebookInput extends EditorInput {
|
||||
return this._textInput;
|
||||
}
|
||||
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<boolean> {
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
return this._textInput.revert(group, options);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { nb } from 'azdata';
|
||||
import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, OnDestroy, ViewChildren, QueryList } from '@angular/core';
|
||||
|
||||
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { INotificationService, INotification } from 'vs/platform/notification/common/notification';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -54,6 +54,7 @@ import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
import { CodeCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/codeCell.component';
|
||||
import { TextCellComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/textCell.component';
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
|
||||
|
||||
@@ -260,7 +261,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
});
|
||||
this.notificationService.error(errorWithAction);
|
||||
|
||||
let editors = this.editorService.visibleControls;
|
||||
let editors = this.editorService.visibleEditorPanes;
|
||||
for (let editor of editors) {
|
||||
if (editor && editor.input.resource === this._notebookParams.input.notebookUri) {
|
||||
await editor.group.closeEditor(this._notebookParams.input as NotebookInput, { preserveFocus: true }); // sketchy
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import 'vs/css!./notebook';
|
||||
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { SIDE_BAR_BACKGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { activeContrastBorder, contrastBorder, buttonBackground, textLinkForeground, textLinkActiveForeground, textPreformatForeground, textBlockQuoteBackground, textBlockQuoteBorder, buttonForeground, editorBackground, lighten } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { editorLineHighlight, editorLineHighlightBorder } from 'vs/editor/common/view/editorColorRegistry';
|
||||
@@ -15,7 +15,7 @@ import { getZoomLevel } from 'vs/base/browser/browser';
|
||||
import * as types from 'vs/base/common/types';
|
||||
|
||||
export function registerNotebookThemes(overrideEditorThemeSetting: boolean, configurationService: IConfigurationService): IDisposable {
|
||||
return registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
return registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
|
||||
let lightBoxShadow = '0px 4px 6px 0px rgba(0, 0, 0, 0.14)';
|
||||
let darkBoxShadow = '0px 4px 6px 0px rgba(0, 0, 0, 1)';
|
||||
|
||||
@@ -660,7 +660,7 @@ export class NotebookIntervalNode {
|
||||
abstract class SettingsCommand extends Command {
|
||||
|
||||
protected getNotebookEditor(accessor: ServicesAccessor): NotebookEditor {
|
||||
const activeEditor = accessor.get(IEditorService).activeControl;
|
||||
const activeEditor = accessor.get(IEditorService).activeEditorPane;
|
||||
if (activeEditor instanceof NotebookEditor) {
|
||||
return activeEditor;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import { IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference
|
||||
import { FIND_IDS, CONTEXT_FIND_INPUT_FOCUSED } from 'vs/editor/contrib/find/findModel';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -159,8 +159,8 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
|
||||
this._notebookController.addOverlayWidget(this);
|
||||
|
||||
this._applyTheme(themeService.getTheme());
|
||||
this._register(themeService.onThemeChange(this._applyTheme.bind(this)));
|
||||
this._applyTheme(themeService.getColorTheme());
|
||||
this._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this)));
|
||||
|
||||
this.onkeyup(this._domNode, e => {
|
||||
if (e.equals(KeyCode.Escape)) {
|
||||
@@ -299,7 +299,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
}
|
||||
}
|
||||
|
||||
private _applyTheme(theme: ITheme) {
|
||||
private _applyTheme(theme: IColorTheme) {
|
||||
let inputStyles: IFindInputStyles = {
|
||||
inputActiveOptionBorder: theme.getColor(colors.inputActiveOptionBorder),
|
||||
inputBackground: theme.getColor(colors.inputBackground),
|
||||
|
||||
@@ -28,7 +28,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
|
||||
import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { TestEnvironmentService, TestLifecycleService, TestStorageService, TestTextFileService, workbenchInstantiationService, TestTextResourcePropertiesService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestEnvironmentService, TestLifecycleService, TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { nb } from 'azdata';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
@@ -38,6 +38,7 @@ import { startsWith } from 'vs/base/common/strings';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TestStorageService, TestTextResourcePropertiesService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
|
||||
class ServiceAccessor {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/t
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ClientSession } from 'sql/workbench/services/notebook/browser/models/clientSession';
|
||||
import { TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { NotebookEditorContentManager } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { NotebookRange } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { NotebookMarkdownRenderer } from 'sql/workbench/contrib/notebook/browser/outputs/notebookMarkdown';
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Memento } from 'vs/workbench/common/memento';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
|
||||
@@ -33,6 +33,7 @@ import { $ } from 'vs/base/browser/dom';
|
||||
import { OEManageConnectionAction } from 'sql/workbench/contrib/dashboard/browser/dashboardActions';
|
||||
import { IViewsService, IView } from 'vs/workbench/common/views';
|
||||
import { ConsoleLogService } from 'vs/platform/log/common/log';
|
||||
import { IProgressIndicator } from 'vs/platform/progress/common/progress';
|
||||
|
||||
suite('SQL Connection Tree Action tests', () => {
|
||||
let errorMessageService: TypeMoq.Mock<TestErrorMessageService>;
|
||||
@@ -109,6 +110,9 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
});
|
||||
|
||||
const viewsService = new class implements IViewsService {
|
||||
getProgressIndicator(id: string): IProgressIndicator {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
getActiveViewWithId<T extends IView>(id: string): T | null {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
let profilerService: IProfilerService = accessor.get(IProfilerService);
|
||||
let editorService: IEditorService = accessor.get(IEditorService);
|
||||
|
||||
let activeEditor = editorService.activeControl;
|
||||
let activeEditor = editorService.activeEditorPane;
|
||||
if (activeEditor instanceof ProfilerEditor) {
|
||||
let profilerInput = activeEditor.input;
|
||||
if (profilerInput.state.isRunning) {
|
||||
|
||||
@@ -297,13 +297,13 @@ export class ProfilerEditor extends BaseEditor {
|
||||
profilerTableContainer.style.height = '100%';
|
||||
profilerTableContainer.style.overflow = 'hidden';
|
||||
profilerTableContainer.style.position = 'relative';
|
||||
let theme = this.themeService.getTheme();
|
||||
let theme = this.themeService.getColorTheme();
|
||||
if (theme.type === DARK) {
|
||||
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
|
||||
} else if (theme.type === HIGH_CONTRAST) {
|
||||
DOM.addClass(profilerTableContainer, VS_HC_THEME);
|
||||
}
|
||||
this.themeService.onThemeChange(e => {
|
||||
this.themeService.onDidColorThemeChange(e => {
|
||||
DOM.removeClasses(profilerTableContainer, VS_DARK_THEME, VS_HC_THEME);
|
||||
if (e.type === DARK) {
|
||||
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
|
||||
@@ -623,7 +623,7 @@ export class ProfilerEditor extends BaseEditor {
|
||||
abstract class SettingsCommand extends Command {
|
||||
|
||||
protected getProfilerEditor(accessor: ServicesAccessor): ProfilerEditor {
|
||||
const activeEditor = accessor.get(IEditorService).activeControl;
|
||||
const activeEditor = accessor.get(IEditorService).activeEditorPane;
|
||||
if (activeEditor instanceof ProfilerEditor) {
|
||||
return activeEditor;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import { IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference
|
||||
import { FIND_IDS, CONTEXT_FIND_INPUT_FOCUSED } from 'vs/editor/contrib/find/findModel';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -156,8 +156,8 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
|
||||
this._tableController.addOverlayWidget(this);
|
||||
|
||||
this._applyTheme(themeService.getTheme());
|
||||
this._register(themeService.onThemeChange(this._applyTheme.bind(this)));
|
||||
this._applyTheme(themeService.getColorTheme());
|
||||
this._register(themeService.onDidColorThemeChange(this._applyTheme.bind(this)));
|
||||
}
|
||||
|
||||
// ----- IOverlayWidget API
|
||||
@@ -288,7 +288,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
}
|
||||
}
|
||||
|
||||
private _applyTheme(theme: ITheme) {
|
||||
private _applyTheme(theme: IColorTheme) {
|
||||
let inputStyles: IFindInputStyles = {
|
||||
inputActiveOptionBorder: theme.getColor(colors.inputActiveOptionBorder),
|
||||
inputBackground: theme.getColor(colors.inputBackground),
|
||||
|
||||
@@ -221,7 +221,7 @@ export class ChartDataAction extends Action {
|
||||
// show the visualizer extension recommendation notification
|
||||
this.extensionTipsService.promptRecommendedExtensionsByScenario(Constants.visualizerExtensions);
|
||||
|
||||
const activeEditor = this.editorService.activeControl as QueryEditor;
|
||||
const activeEditor = this.editorService.activeEditorPane as QueryEditor;
|
||||
activeEditor.chart({ batchId: context.batchId, resultId: context.resultId });
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ export class SqlFlavorStatusbarItem extends Disposable implements IWorkbenchCont
|
||||
let uri = event.editor.resource.toString();
|
||||
if (uri && uri in this._sqlStatusEditors) {
|
||||
// If active editor is being closed, hide the query status.
|
||||
let activeEditor = this.editorService.activeControl;
|
||||
let activeEditor = this.editorService.activeEditorPane;
|
||||
if (activeEditor) {
|
||||
let currentUri = activeEditor.input.resource.toString();
|
||||
if (uri === currentUri) {
|
||||
@@ -112,7 +112,7 @@ export class SqlFlavorStatusbarItem extends Disposable implements IWorkbenchCont
|
||||
}
|
||||
|
||||
private _onEditorsChanged(): void {
|
||||
let activeEditor = this.editorService.activeControl;
|
||||
let activeEditor = this.editorService.activeEditorPane;
|
||||
if (activeEditor) {
|
||||
let uri = activeEditor.input.resource.toString();
|
||||
|
||||
@@ -143,7 +143,7 @@ export class SqlFlavorStatusbarItem extends Disposable implements IWorkbenchCont
|
||||
|
||||
// Show/hide query status for active editor
|
||||
private _showStatus(uri: string): void {
|
||||
let activeEditor = this.editorService.activeControl;
|
||||
let activeEditor = this.editorService.activeEditorPane;
|
||||
if (activeEditor) {
|
||||
let currentUri = activeEditor.input.resource.toString();
|
||||
if (uri === currentUri) {
|
||||
@@ -185,7 +185,7 @@ export class ChangeFlavorAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
let activeEditor = this._editorService.activeControl;
|
||||
let activeEditor = this._editorService.activeEditorPane;
|
||||
let currentUri = activeEditor?.input.resource.toString();
|
||||
if (this._connectionManagementService.isConnected(currentUri)) {
|
||||
let currentProvider = this._connectionManagementService.getProviderIdFromUri(currentUri);
|
||||
@@ -206,7 +206,7 @@ export class ChangeFlavorAction extends Action {
|
||||
|
||||
return this._quickInputService.pick(providerOptions, { placeHolder: nls.localize('pickSqlProvider', "Select SQL Language Provider") }).then(provider => {
|
||||
if (provider) {
|
||||
let activeEditor = this._editorService.activeControl.getControl();
|
||||
let activeEditor = this._editorService.activeEditorPane.getControl();
|
||||
const editorWidget = getCodeEditor(activeEditor);
|
||||
if (editorWidget) {
|
||||
if (currentUri) {
|
||||
|
||||
@@ -33,7 +33,7 @@ function isConnected(editor: QueryEditor, connectionManagementService: IConnecti
|
||||
}
|
||||
|
||||
function runActionOnActiveQueryEditor(editorService: IEditorService, action: (QueryEditor) => void): void {
|
||||
const candidates = [editorService.activeControl, ...editorService.visibleControls].filter(e => e instanceof QueryEditor);
|
||||
const candidates = [editorService.activeEditorPane, ...editorService.visibleEditorPanes].filter(e => e instanceof QueryEditor);
|
||||
if (candidates.length > 0) {
|
||||
action(candidates[0]);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ export class FocusOnCurrentQueryKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.focus();
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class RunQueryKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor || editor instanceof EditDataEditor) {
|
||||
editor.runQuery();
|
||||
}
|
||||
@@ -124,7 +124,7 @@ export class RunCurrentQueryKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.runCurrentQuery();
|
||||
}
|
||||
@@ -146,7 +146,7 @@ export class RunCurrentQueryWithActualPlanKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.runCurrentQueryWithActualPlan();
|
||||
}
|
||||
@@ -172,7 +172,7 @@ export class CancelQueryKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor || editor instanceof EditDataEditor) {
|
||||
editor.cancelQuery();
|
||||
}
|
||||
@@ -224,7 +224,7 @@ export class ToggleQueryResultsKeyboardAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this._editorService.activeControl;
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.toggleResultsEditorVisibility();
|
||||
}
|
||||
@@ -404,7 +404,7 @@ export class ParseSyntaxAction extends Action {
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
const editor = this.editorService.activeControl;
|
||||
const editor = this.editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
if (!editor.isSelectionEmpty()) {
|
||||
if (this.isConnected(editor)) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { OpenMode, ClickBehavior, ICancelableEvent, IControllerOptions } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
import { WorkbenchTreeController } from 'vs/platform/list/browser/listService';
|
||||
@@ -102,8 +102,8 @@ export class MessagePanel extends Disposable {
|
||||
this.container.style.width = '100%';
|
||||
this.container.style.height = '100%';
|
||||
this._register(attachListStyler(this.tree, this.themeService));
|
||||
this._register(this.themeService.onThemeChange(this.applyStyles, this));
|
||||
this.applyStyles(this.themeService.getTheme());
|
||||
this._register(this.themeService.onDidColorThemeChange(this.applyStyles, this));
|
||||
this.applyStyles(this.themeService.getColorTheme());
|
||||
this.controller.onKeyDown = (tree, event) => {
|
||||
if (event.ctrlKey && event.code === 'KeyC') {
|
||||
let context: IMessagesActionContext = {
|
||||
@@ -210,7 +210,7 @@ export class MessagePanel extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private applyStyles(theme: ITheme): void {
|
||||
private applyStyles(theme: IColorTheme): void {
|
||||
const errorColor = theme.getColor(resultsErrorColor);
|
||||
const content: string[] = [];
|
||||
if (errorColor) {
|
||||
@@ -387,7 +387,7 @@ export class MessageController extends WorkbenchTreeController {
|
||||
if (element.selection) {
|
||||
let selection: ISelectionData = element.selection;
|
||||
// this is a batch statement
|
||||
let editor = this.workbenchEditorService.activeControl as QueryEditor;
|
||||
let editor = this.workbenchEditorService.activeEditorPane as QueryEditor;
|
||||
const codeEditor = <ICodeEditor>editor.getControl();
|
||||
codeEditor.focus();
|
||||
codeEditor.setSelection({ endColumn: selection.endColumn + 1, endLineNumber: selection.endLine + 1, startColumn: selection.startColumn + 1, startLineNumber: selection.startLine + 1 });
|
||||
|
||||
@@ -394,7 +394,7 @@ export class QueryEditor extends BaseEditor {
|
||||
let visible = currentEditorIsVisible;
|
||||
if (!currentEditorIsVisible) {
|
||||
// Current editor is closing but still tracked as visible. Check if any other editor is visible
|
||||
const candidates = [...this.editorService.visibleControls].filter(e => {
|
||||
const candidates = [...this.editorService.visibleEditorPanes].filter(e => {
|
||||
if (e && e.getId) {
|
||||
return e.getId() === QueryEditor.ID;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { TestStorageService, TestFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestFileService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
import { UntitledQueryEditorInput } from 'sql/workbench/common/editor/query/untitledQueryEditorInput';
|
||||
import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService';
|
||||
@@ -33,6 +33,7 @@ import { TestConnectionManagementService } from 'sql/platform/connection/test/co
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
suite('SQL QueryAction Tests', () => {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { TestStorageService, workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { UntitledQueryEditorInput } from 'sql/workbench/common/editor/query/untitledQueryEditorInput';
|
||||
@@ -27,6 +27,7 @@ import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/commo
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
suite('SQL QueryEditor Tests', () => {
|
||||
let instantiationService: TypeMoq.Mock<InstantiationService>;
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as QP from 'html-query-plan';
|
||||
import { IQueryPlanParams, IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { registerThemingParticipant, ICssStyleCollector, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { registerThemingParticipant, ICssStyleCollector, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
export const QUERYPLAN_SELECTOR: string = 'queryplan-component';
|
||||
@@ -53,7 +53,7 @@ export class QueryPlanComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private _updateTheme(theme: ITheme, collector: ICssStyleCollector) {
|
||||
private _updateTheme(theme: IColorTheme, collector: ICssStyleCollector) {
|
||||
let backgroundColor = theme.getColor(colors.editorBackground);
|
||||
let foregroundColor = theme.getColor(colors.editorForeground);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWebviewService, WebviewElement } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
@@ -22,6 +21,7 @@ import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class WebViewDialog extends Modal {
|
||||
|
||||
@@ -44,7 +44,7 @@ export class WebViewDialog extends Modal {
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@@ -91,7 +91,7 @@ export class WebViewDialog extends Modal {
|
||||
protected renderBody(container: HTMLElement) {
|
||||
this._body = DOM.append(container, DOM.$('div.webview-dialog'));
|
||||
|
||||
this._webview = this.webviewService.createWebview(this.id,
|
||||
this._webview = this.webviewService.createWebviewElement(this.id,
|
||||
{},
|
||||
{
|
||||
allowScripts: true
|
||||
|
||||
@@ -32,7 +32,6 @@ import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 's
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { IViewPaneOptions, ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
@@ -40,6 +39,7 @@ import { attachModalDialogStyler, attachPanelStyler } from 'sql/workbench/common
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
class AccountPanel extends ViewPane {
|
||||
public index: number;
|
||||
@@ -123,7 +123,7 @@ export class AccountDialog extends Modal {
|
||||
public get onCloseEvent(): Event<void> { return this._onCloseEmitter.event; }
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IContextMenuService private _contextMenuService: IContextMenuService,
|
||||
@@ -298,8 +298,7 @@ export class AccountDialog extends Modal {
|
||||
let providerView = new AccountPanel(
|
||||
{
|
||||
id: newProvider.addedProvider.id,
|
||||
title: newProvider.addedProvider.displayName,
|
||||
ariaHeaderLabel: newProvider.addedProvider.displayName
|
||||
title: newProvider.addedProvider.displayName
|
||||
},
|
||||
this._keybindingService,
|
||||
this._contextMenuService,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { DropdownList } from 'sql/base/browser/ui/dropdownList/dropdownList';
|
||||
@@ -107,7 +107,7 @@ export class AccountPicker extends Disposable {
|
||||
|
||||
this._dropdown = this._register(new DropdownList(this._rootElement, option, this._listContainer, this._accountList, addAccountAction));
|
||||
this._register(attachDropdownStyler(this._dropdown, this._themeService));
|
||||
this._register(this._accountList.onSelectionChange((e: IListEvent<azdata.Account>) => {
|
||||
this._register(this._accountList.onDidChangeSelection((e: IListEvent<azdata.Account>) => {
|
||||
if (e.elements.length === 1) {
|
||||
this._dropdown.renderLabel();
|
||||
this.onAccountSelectionChange(e.elements[0]);
|
||||
@@ -128,8 +128,8 @@ export class AccountPicker extends Disposable {
|
||||
DOM.hide(this._refreshContainer);
|
||||
}
|
||||
|
||||
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getTheme());
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getColorTheme());
|
||||
|
||||
// Load the initial contents of the view model
|
||||
this.viewModel.initialize()
|
||||
@@ -226,7 +226,7 @@ export class AccountPicker extends Disposable {
|
||||
/**
|
||||
* Update theming that is specific to account picker
|
||||
*/
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
const linkColor = theme.getColor(buttonBackground);
|
||||
const link = linkColor ? linkColor.toString() : null;
|
||||
this._refreshContainer.style.color = link;
|
||||
|
||||
@@ -21,10 +21,10 @@ import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class AutoOAuthDialog extends Modal {
|
||||
private _copyAndOpenButton: Button;
|
||||
@@ -45,7 +45,7 @@ export class AutoOAuthDialog extends Modal {
|
||||
public get onCloseEvent(): Event<void> { return this._onCloseEvent.event; }
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
|
||||
@@ -13,7 +13,7 @@ import { AccountAdditionResult, AccountProviderAddedEventParams, UpdateAccountLi
|
||||
import { IAccountStore } from 'sql/platform/accounts/common/interfaces';
|
||||
import { AccountProviderStub } from 'sql/platform/accounts/test/common/testAccountManagementService';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { TestStorageService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { EventVerifierSingle } from 'sql/base/test/common/event';
|
||||
|
||||
// SUITE CONSTANTS /////////////////////////////////////////////////////////
|
||||
|
||||
@@ -33,13 +33,13 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { entries } from 'sql/base/common/collections';
|
||||
import { attachTabbedPanelStyler, attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export interface OnShowUIResponse {
|
||||
selectedProviderDisplayName: string;
|
||||
@@ -94,7 +94,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IContextMenuService private _contextMenuService: IContextMenuService,
|
||||
@@ -220,8 +220,8 @@ export class ConnectionDialogWidget extends Modal {
|
||||
this._connectionUIContainer = DOM.$('.connection-provider-info', { id: 'connectionProviderInfo' });
|
||||
this._body.append(this._connectionUIContainer);
|
||||
|
||||
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getTheme());
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getColorTheme());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +240,7 @@ export class ConnectionDialogWidget extends Modal {
|
||||
}
|
||||
|
||||
// Update theming that is specific to connection flyout body
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
const borderColor = theme.getColor(contrastBorder);
|
||||
const border = borderColor ? borderColor.toString() : null;
|
||||
const backgroundColor = theme.getColor(SIDE_BAR_BACKGROUND);
|
||||
|
||||
@@ -527,7 +527,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
});
|
||||
}
|
||||
|
||||
private doActionsAfterConnectionComplete(uri: string, options: IConnectionCompletionOptions, ) {
|
||||
private doActionsAfterConnectionComplete(uri: string, options: IConnectionCompletionOptions,) {
|
||||
let connectionManagementInfo = this._connectionStatusManager.findConnection(uri);
|
||||
if (options.showDashboard) {
|
||||
this.showDashboardForConnectionManagementInfo(connectionManagementInfo.connectionProfile);
|
||||
|
||||
@@ -28,12 +28,13 @@ import * as TypeMoq from 'typemoq';
|
||||
import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService';
|
||||
import { TestStorageService, TestEnvironmentService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestEnvironmentService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { NullAdsTelemetryService } from 'sql/platform/telemetry/common/adsTelemetryService';
|
||||
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
|
||||
suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/service
|
||||
import { IDashboardTab } from 'sql/workbench/services/dashboard/browser/common/interfaces';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
class ExtensionListDelegate implements IListVirtualDelegate<IDashboardUITab> {
|
||||
|
||||
@@ -108,7 +108,7 @@ export class NewDashboardTabDialog extends Modal {
|
||||
public get onCancel(): Event<void> { return this._onCancel.event; }
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
|
||||
@@ -18,13 +18,13 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { DialogMessage } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class DialogModal extends Modal {
|
||||
private _dialogPane: DialogPane;
|
||||
@@ -38,7 +38,7 @@ export class DialogModal extends Modal {
|
||||
private _dialog: Dialog,
|
||||
name: string,
|
||||
options: IModalOptions,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IWorkbenchThemeService themeService: IWorkbenchThemeService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
|
||||
@@ -21,11 +21,11 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
import { append, $ } from 'vs/base/browser/dom';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class WizardModal extends Modal {
|
||||
private _dialogPanes = new Map<WizardPage, DialogPane>();
|
||||
@@ -47,7 +47,7 @@ export class WizardModal extends Modal {
|
||||
private _wizard: Wizard,
|
||||
name: string,
|
||||
options: IModalOptions,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
|
||||
@@ -47,7 +47,7 @@ export class WizardNavigation implements AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this._themeService.onThemeChange(() => this.style());
|
||||
this._themeService.onDidColorThemeChange(() => this.style());
|
||||
this.style();
|
||||
this._params.wizard.onPageChanged(() => this._changeRef.detectChanges());
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class WizardNavigation implements AfterViewInit {
|
||||
}
|
||||
|
||||
private style(): void {
|
||||
let theme = this._themeService.getTheme();
|
||||
let theme = this._themeService.getColorTheme();
|
||||
let navigationBackgroundColor = theme.getColor(SIDE_BAR_BACKGROUND);
|
||||
if (theme.type === 'light') {
|
||||
navigationBackgroundColor = navigationBackgroundColor.lighten(0.03);
|
||||
|
||||
@@ -19,11 +19,11 @@ import { localize } from 'vs/nls';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
const maxActions = 1;
|
||||
|
||||
@@ -46,7 +46,7 @@ export class ErrorMessageDialog extends Modal {
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
|
||||
@@ -28,11 +28,11 @@ import * as strings from 'vs/base/common/strings';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
export class FileBrowserDialog extends Modal {
|
||||
private _viewModel: FileBrowserViewModel;
|
||||
@@ -50,7 +50,7 @@ export class FileBrowserDialog extends Modal {
|
||||
private _isFolderSelected: boolean;
|
||||
|
||||
constructor(title: string,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@@ -235,7 +235,7 @@ export class FileBrowserDialog extends Modal {
|
||||
this._register(attachButtonStyler(this._okButton, this._themeService));
|
||||
this._register(attachButtonStyler(this._cancelButton, this._themeService));
|
||||
|
||||
this._register(this._themeService.onThemeChange(e => this.updateTheme()));
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme()));
|
||||
}
|
||||
|
||||
// Update theming that is specific to file browser
|
||||
|
||||
@@ -36,7 +36,6 @@ import { SplitView, Orientation, Sizing } from 'vs/base/browser/ui/splitview/spl
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IInsightsConfigDetails } from 'sql/platform/dashboard/browser/insightRegistry';
|
||||
import { TaskRegistry } from 'sql/workbench/services/tasks/browser/tasksRegistry';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
@@ -47,6 +46,7 @@ import { attachPanelStyler, attachModalDialogStyler } from 'sql/workbench/common
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
const labelDisplay = nls.localize("insights.item", "Item");
|
||||
const valueDisplay = nls.localize("insights.value", "Value");
|
||||
@@ -171,7 +171,7 @@ export class InsightsDialogView extends Modal {
|
||||
private _model: IInsightsDialogModel,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
@@ -222,12 +222,12 @@ export class InsightsDialogView extends Modal {
|
||||
|
||||
this._topTableData = new TableDataView();
|
||||
this._bottomTableData = new TableDataView();
|
||||
let topTableView = this._instantiationService.createInstance(InsightTableView, this._topColumns, this._topTableData, { forceFitColumns: true }, { id: 'insights.top', title: itemsHeaderTitle, ariaHeaderLabel: itemsHeaderTitle }) as InsightTableView<ListResource>;
|
||||
let topTableView = this._instantiationService.createInstance(InsightTableView, this._topColumns, this._topTableData, { forceFitColumns: true }, { id: 'insights.top', title: itemsHeaderTitle }) as InsightTableView<ListResource>;
|
||||
topTableView.render();
|
||||
attachPanelStyler(topTableView, this._themeService);
|
||||
this._topTable = topTableView.table;
|
||||
this._topTable.setSelectionModel(new RowSelectionModel<ListResource>());
|
||||
let bottomTableView = this._instantiationService.createInstance(InsightTableView, this._bottomColumns, this._bottomTableData, { forceFitColumns: true }, { id: 'insights.bottom', title: itemsDetailHeaderTitle, ariaHeaderLabel: itemsDetailHeaderTitle }) as InsightTableView<ListResource>;
|
||||
let bottomTableView = this._instantiationService.createInstance(InsightTableView, this._bottomColumns, this._bottomTableData, { forceFitColumns: true }, { id: 'insights.bottom', title: itemsDetailHeaderTitle }) as InsightTableView<ListResource>;
|
||||
bottomTableView.render();
|
||||
attachPanelStyler(bottomTableView, this._themeService);
|
||||
this._bottomTable = bottomTableView.table;
|
||||
|
||||
@@ -11,97 +11,28 @@ import { resolveQueryFilePath } from 'sql/workbench/services/insights/common/ins
|
||||
import * as path from 'vs/base/common/path';
|
||||
|
||||
import { Workspace, toWorkspaceFolder, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService';
|
||||
import { TestContextService, TestFileService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { IExtensionHostDebugParams, IDebugParams, ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
import { ConfigurationResolverService, BaseConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService';
|
||||
import { TestFileService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { TestContextService } from 'vs/workbench/test/common/workbenchTestServices';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IWindowConfiguration } from 'vs/platform/windows/common/windows';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import * as pfs from 'vs/base/node/pfs';
|
||||
import { getRandomTestPath } from 'vs/base/test/node/testUtils';
|
||||
import { IWorkbenchConstructionOptions } from 'vs/workbench/workbench.web.api';
|
||||
import { IProcessEnvironment } from 'vs/base/common/platform';
|
||||
import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService';
|
||||
import { TestWindowConfiguration } from 'vs/workbench/test/electron-browser/workbenchTestServices';
|
||||
|
||||
class TestEnvironmentService implements IWorkbenchEnvironmentService {
|
||||
userDataSyncHome: URI;
|
||||
keybindingsSyncPreviewResource: URI;
|
||||
argvResource: URI;
|
||||
userDataSyncLogResource: URI;
|
||||
settingsSyncPreviewResource: URI;
|
||||
webviewExternalEndpoint: string;
|
||||
logFile: URI;
|
||||
options?: IWorkbenchConstructionOptions;
|
||||
galleryMachineIdResource?: URI;
|
||||
webviewCspSource: string;
|
||||
webviewCspRule: string;
|
||||
localeResource: URI;
|
||||
userRoamingDataHome: URI;
|
||||
webviewEndpoint?: string;
|
||||
webviewResourceRoot: string;
|
||||
keyboardLayoutResource: URI;
|
||||
machineSettingsResource: URI;
|
||||
keybindingsResource: URI;
|
||||
machineSettingsHome: URI;
|
||||
machineSettingsPath: string;
|
||||
extensionDevelopmentLocationURI?: URI[];
|
||||
|
||||
constructor(private userEnv: { [key: string]: any }) {
|
||||
class MockWorkbenchEnvironmentService extends NativeWorkbenchEnvironmentService {
|
||||
|
||||
constructor(public userEnv: IProcessEnvironment) {
|
||||
super({ ...TestWindowConfiguration, userEnv }, TestWindowConfiguration.execPath);
|
||||
}
|
||||
}
|
||||
|
||||
get configuration(): IWindowConfiguration {
|
||||
return {
|
||||
userEnv: this.userEnv
|
||||
} as IWindowConfiguration;
|
||||
}
|
||||
class TestConfigurationResolverService extends BaseConfigurationResolverService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
args: ParsedArgs;
|
||||
execPath: string;
|
||||
cliPath: string;
|
||||
appRoot: string;
|
||||
userHome: string;
|
||||
userDataPath: string;
|
||||
appNameLong: string;
|
||||
appQuality?: string;
|
||||
appSettingsHome: URI;
|
||||
|
||||
settingsResource: URI;
|
||||
appKeybindingsPath: string;
|
||||
settingsSearchBuildId?: number;
|
||||
settingsSearchUrl?: string;
|
||||
globalStorageHome: string;
|
||||
workspaceStorageHome: string;
|
||||
backupHome: URI;
|
||||
backupWorkspacesPath: string;
|
||||
untitledWorkspacesHome: URI;
|
||||
isExtensionDevelopment: boolean;
|
||||
disableExtensions: boolean | string[];
|
||||
builtinExtensionsPath: string;
|
||||
extensionsPath: string;
|
||||
extensionTestsLocationURI?: URI;
|
||||
debugExtensionHost: IExtensionHostDebugParams;
|
||||
debugSearch: IDebugParams;
|
||||
logExtensionHostCommunication: boolean;
|
||||
isBuilt: boolean;
|
||||
wait: boolean;
|
||||
status: boolean;
|
||||
log?: string;
|
||||
logsPath: string;
|
||||
verbose: boolean;
|
||||
skipGettingStarted: boolean;
|
||||
skipReleaseNotes: boolean;
|
||||
skipAddToRecentlyOpened: boolean;
|
||||
mainIPCHandle: string;
|
||||
sharedIPCHandle: string;
|
||||
nodeCachedDataDir?: string;
|
||||
installSourcePath: string;
|
||||
disableUpdates: boolean;
|
||||
disableCrashReporter: boolean;
|
||||
driverHandle?: string;
|
||||
driverVerbose: boolean;
|
||||
}
|
||||
|
||||
suite('Insights Utils tests', function () {
|
||||
@@ -121,7 +52,7 @@ suite('Insights Utils tests', function () {
|
||||
test('resolveQueryFilePath resolves path correctly with fully qualified path', async () => {
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
undefined,
|
||||
new TestEnvironmentService({}),
|
||||
new MockWorkbenchEnvironmentService({}),
|
||||
undefined,
|
||||
undefined,
|
||||
new TestContextService(),
|
||||
@@ -152,7 +83,7 @@ suite('Insights Utils tests', function () {
|
||||
));
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
undefined,
|
||||
new TestEnvironmentService({}),
|
||||
new MockWorkbenchEnvironmentService({}),
|
||||
undefined,
|
||||
undefined,
|
||||
contextService,
|
||||
@@ -183,7 +114,7 @@ suite('Insights Utils tests', function () {
|
||||
);
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
undefined,
|
||||
new TestEnvironmentService({}),
|
||||
new MockWorkbenchEnvironmentService({}),
|
||||
undefined,
|
||||
undefined,
|
||||
contextService,
|
||||
@@ -216,7 +147,7 @@ suite('Insights Utils tests', function () {
|
||||
'TestWorkspace'));
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
undefined,
|
||||
new TestEnvironmentService({}),
|
||||
new MockWorkbenchEnvironmentService({}),
|
||||
undefined,
|
||||
undefined,
|
||||
contextService,
|
||||
@@ -245,10 +176,12 @@ suite('Insights Utils tests', function () {
|
||||
const contextService = new TestContextService(
|
||||
new Workspace('TestWorkspace'));
|
||||
|
||||
const environmentService = new MockWorkbenchEnvironmentService({ TEST_PATH: queryFileDir });
|
||||
|
||||
// Create mock window service with env variable containing test folder for resolution
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
const configurationResolverService = new TestConfigurationResolverService(environmentService.userEnv,
|
||||
undefined,
|
||||
new TestEnvironmentService({ TEST_PATH: queryFileDir }),
|
||||
environmentService,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -273,10 +206,12 @@ suite('Insights Utils tests', function () {
|
||||
const contextService = new TestContextService(
|
||||
new Workspace('TestWorkspace', [toWorkspaceFolder(URI.file(os.tmpdir()))]));
|
||||
|
||||
const environmentService = new MockWorkbenchEnvironmentService({ TEST_PATH: queryFileDir });
|
||||
|
||||
// Create mock window service with env variable containing test folder for resolution
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
const configurationResolverService = new TestConfigurationResolverService(environmentService.userEnv,
|
||||
undefined,
|
||||
new TestEnvironmentService({ TEST_PATH: queryFileDir }),
|
||||
environmentService,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -301,7 +236,7 @@ suite('Insights Utils tests', function () {
|
||||
const invalidPath = path.join('${INVALID}', 'test.sql');
|
||||
const configurationResolverService = new ConfigurationResolverService(
|
||||
undefined,
|
||||
new TestEnvironmentService({}),
|
||||
new MockWorkbenchEnvironmentService({}),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
|
||||
@@ -23,10 +23,10 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
class EventItem {
|
||||
|
||||
@@ -311,7 +311,7 @@ export class ProfilerColumnEditorDialog extends Modal {
|
||||
private _treeContainer: HTMLElement;
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
|
||||
@@ -23,12 +23,12 @@ import * as DOM from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { ProfilerFilter, ProfilerFilterClause, ProfilerFilterClauseOperator, IProfilerService } from 'sql/workbench/services/profiler/browser/interfaces';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { find, firstIndex } from 'vs/base/common/arrays';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
|
||||
const ClearText: string = localize('profilerFilterDialog.clear', "Clear all");
|
||||
@@ -76,7 +76,7 @@ export class ProfilerFilterDialog extends Modal {
|
||||
constructor(
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@ILogService logService: ILogService,
|
||||
|
||||
@@ -47,7 +47,7 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath });
|
||||
|
||||
// Create a sql document pane with accoutrements
|
||||
const fileInput = this._editorService.createInput({ forceUntitled: true, resource: docUri, mode: 'sql' }) as UntitledTextEditorInput;
|
||||
const fileInput = this._editorService.createEditorInput({ forceUntitled: true, resource: docUri, mode: 'sql' }) as UntitledTextEditorInput;
|
||||
let untitledEditorModel = await fileInput.resolve() as UntitledTextEditorModel;
|
||||
if (sqlContent) {
|
||||
untitledEditorModel.textEditorModel.setValue(sqlContent);
|
||||
@@ -82,7 +82,7 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath });
|
||||
|
||||
// Create a sql document pane with accoutrements
|
||||
const fileInput = this._editorService.createInput({ forceUntitled: true, resource: docUri, mode: 'sql' }) as UntitledTextEditorInput;
|
||||
const fileInput = this._editorService.createEditorInput({ forceUntitled: true, resource: docUri, mode: 'sql' }) as UntitledTextEditorInput;
|
||||
const m = await fileInput.resolve() as UntitledTextEditorModel;
|
||||
//when associatedResource editor is created it is dirty, this must be set to false to be able to detect changes to the editor.
|
||||
m.setDirty(false);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
@@ -27,11 +27,11 @@ import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import { IAccountPickerService } from 'sql/workbench/services/accountManagement/browser/accountPicker';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
|
||||
// in case that other non-Azure sign in is to be used
|
||||
@@ -66,7 +66,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
|
||||
constructor(
|
||||
@IAccountPickerService private _accountPickerService: IAccountPickerService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@@ -184,8 +184,8 @@ export class FirewallRuleDialog extends Modal {
|
||||
ariaLabel: LocalizedStrings.TO
|
||||
});
|
||||
|
||||
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getTheme());
|
||||
this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
|
||||
this.updateTheme(this._themeService.getColorTheme());
|
||||
|
||||
this._register(DOM.addDisposableListener(this._IPAddressElement, DOM.EventType.CLICK, () => {
|
||||
this.onFirewallRuleOptionSelected(true);
|
||||
@@ -219,7 +219,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
}
|
||||
|
||||
// Update theming that is specific to firewall rule flyout body
|
||||
private updateTheme(theme: ITheme): void {
|
||||
private updateTheme(theme: IColorTheme): void {
|
||||
const linkColor = theme.getColor(buttonBackground);
|
||||
const link = linkColor ? linkColor.toString() : null;
|
||||
if (this._helpLink) {
|
||||
|
||||
@@ -40,11 +40,11 @@ import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { IFileBrowserDialogController } from 'sql/workbench/services/fileBrowser/common/fileBrowserDialogController';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler, attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { fileFiltersSet } from 'sql/workbench/services/restore/common/constants';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
interface FileListElement {
|
||||
logicalFileName: string;
|
||||
@@ -131,7 +131,7 @@ export class RestoreDialog extends Modal {
|
||||
|
||||
constructor(
|
||||
optionsMetadata: azdata.ServiceOption[],
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
|
||||
@@ -25,12 +25,12 @@ import { attachButtonStyler } from 'sql/platform/theme/common/styler';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { attachModalDialogStyler } from 'sql/workbench/common/styler';
|
||||
import { assertIsDefined, isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
|
||||
|
||||
interface IRenderedServerGroupDialog {
|
||||
groupNameInputBox: InputBox;
|
||||
@@ -64,7 +64,7 @@ export class ServerGroupDialog extends Modal {
|
||||
private _closeButton?: Button;
|
||||
|
||||
constructor(
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@ILayoutService layoutService: ILayoutService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@IAdsTelemetryService telemetryService: IAdsTelemetryService,
|
||||
|
||||
Reference in New Issue
Block a user