mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user