mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -60,7 +60,7 @@ abstract class AsmtServerAction extends Action {
|
||||
super(id, label, TARGET_ICON_CLASS[AssessmentTargetType.Server]);
|
||||
}
|
||||
|
||||
public async run(context: IAsmtActionInfo): Promise<void> {
|
||||
public override async run(context: IAsmtActionInfo): Promise<void> {
|
||||
this._telemetryService.sendActionEvent(TelemetryView.SqlAssessment, this.id);
|
||||
if (context && context.component && !context.component.isBusy) {
|
||||
context.component.showProgress(this.asmtType);
|
||||
@@ -133,7 +133,7 @@ export class AsmtDatabaseSelectItemsAction extends Action {
|
||||
TARGET_ICON_CLASS[AssessmentTargetType.Database]);
|
||||
}
|
||||
|
||||
public async run(context: IAsmtActionInfo): Promise<void> {
|
||||
public override async run(context: IAsmtActionInfo): Promise<void> {
|
||||
this._telemetryService.sendActionEvent(TelemetryView.SqlAssessment, this.id);
|
||||
if (context && context.component && !context.component.isBusy) {
|
||||
context.component.showProgress(AssessmentType.AvailableRules);
|
||||
@@ -179,7 +179,7 @@ export class AsmtDatabaseInvokeItemsAction extends Action {
|
||||
TARGET_ICON_CLASS[AssessmentTargetType.Database]);
|
||||
}
|
||||
|
||||
public async run(context: IAsmtActionInfo): Promise<void> {
|
||||
public override async run(context: IAsmtActionInfo): Promise<void> {
|
||||
this._telemetryService.sendActionEvent(TelemetryView.SqlAssessment, this.id);
|
||||
if (context && context.component && !context.component.isBusy) {
|
||||
context.component.showProgress(AssessmentType.InvokeAssessment);
|
||||
@@ -201,7 +201,7 @@ export class AsmtExportAsScriptAction extends Action {
|
||||
super(AsmtExportAsScriptAction.ID, AsmtExportAsScriptAction.LABEL, 'exportAsScriptIcon');
|
||||
}
|
||||
|
||||
public async run(context: IAsmtActionInfo): Promise<void> {
|
||||
public override async run(context: IAsmtActionInfo): Promise<void> {
|
||||
this._telemetryService.sendActionEvent(TelemetryView.SqlAssessment, AsmtExportAsScriptAction.ID);
|
||||
const items = context?.component?.recentResult?.result.items;
|
||||
if (items) {
|
||||
@@ -224,7 +224,7 @@ export class AsmtSamplesLinkAction extends Action {
|
||||
super(AsmtSamplesLinkAction.ID, AsmtSamplesLinkAction.LABEL, AsmtSamplesLinkAction.ICON);
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
public override async run(): Promise<void> {
|
||||
this._telemetryService.sendActionEvent(TelemetryView.SqlAssessment, AsmtSamplesLinkAction.ID);
|
||||
await this._openerService.open(URI.parse(AsmtSamplesLinkAction.configHelpUri));
|
||||
}
|
||||
@@ -252,7 +252,7 @@ export class AsmtGenerateHTMLReportAction extends Action {
|
||||
return URI.file(filePath);
|
||||
}
|
||||
|
||||
public async run(context: IAsmtActionInfo): Promise<void> {
|
||||
public override async run(context: IAsmtActionInfo): Promise<void> {
|
||||
context.component.showProgress(AssessmentType.ReportGeneration);
|
||||
const choosenPath = await this._fileDialogService.pickFileToSave(this.suggestReportFile(context.component.recentResult.dateUpdated));
|
||||
context.component.stopProgress(AssessmentType.ReportGeneration);
|
||||
|
||||
@@ -47,6 +47,7 @@ import { LocalizedStrings } from 'sql/workbench/contrib/assessment/common/string
|
||||
import { ConnectionManagementInfo } from 'sql/platform/connection/common/connectionManagementInfo';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { attachTableFilterStyler } from 'sql/platform/theme/common/styler';
|
||||
import { DASHBOARD_BORDER } from 'sql/workbench/common/theme';
|
||||
|
||||
export const ASMTRESULTSVIEW_SELECTOR: string = 'asmt-results-view-component';
|
||||
export const ROW_HEIGHT: number = 25;
|
||||
@@ -168,7 +169,7 @@ export class AsmtResultsViewComponent extends TabChild implements IAssessmentCom
|
||||
this._telemetryService.sendViewEvent(TelemetryView.SqlAssessment);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
override ngOnDestroy(): void {
|
||||
this.isVisible = false;
|
||||
this.rowDetail?.destroy();
|
||||
this.filterPlugin.destroy();
|
||||
@@ -588,7 +589,7 @@ export class AsmtResultsViewComponent extends TabChild implements IAssessmentCom
|
||||
}
|
||||
|
||||
private _updateStyles(theme: IColorTheme): void {
|
||||
this.actionBarContainer.nativeElement.style.borderTopColor = theme.getColor(themeColors.DASHBOARD_BORDER, true).toString();
|
||||
this.actionBarContainer.nativeElement.style.borderTopColor = theme.getColor(DASHBOARD_BORDER, true).toString();
|
||||
let tableStyle: ITableStyles = {
|
||||
tableHeaderBackground: theme.getColor(themeColors.PANEL_BACKGROUND)
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ export class BackupDialog extends Modal {
|
||||
this._body = append(container, $('.backup-dialog'));
|
||||
}
|
||||
|
||||
public render() {
|
||||
public override render() {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
|
||||
@@ -74,7 +74,7 @@ export class BackupDialog extends Modal {
|
||||
}
|
||||
|
||||
/* Overwrite escape key behavior */
|
||||
protected onClose() {
|
||||
protected override onClose() {
|
||||
this.close();
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export class BackupDialog extends Modal {
|
||||
this.hide('close');
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
if (this._moduleRef) {
|
||||
this._moduleRef.destroy();
|
||||
|
||||
@@ -45,7 +45,7 @@ export class CreateInsightAction extends Action {
|
||||
super(CreateInsightAction.ID, CreateInsightAction.LABEL, CreateInsightAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IChartActionContext): Promise<void> {
|
||||
public override async run(context: IChartActionContext): Promise<void> {
|
||||
let uriString = this.getActiveUriString();
|
||||
if (!uriString) {
|
||||
this.showError(localize('createInsightNoEditor', "Cannot create insight as the active editor is not a SQL Editor"));
|
||||
@@ -115,7 +115,7 @@ export class ConfigureChartAction extends Action {
|
||||
super(ConfigureChartAction.ID, ConfigureChartAction.LABEL, ConfigureChartAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IChartActionContext): Promise<void> {
|
||||
public override async run(context: IChartActionContext): Promise<void> {
|
||||
if (!this.dialog) {
|
||||
this.dialog = this.instantiationService.createInstance(ConfigureChartDialog, ConfigureChartAction.LABEL, ConfigureChartAction.ID, this._chart);
|
||||
this.dialog.render();
|
||||
@@ -136,7 +136,7 @@ export class CopyAction extends Action {
|
||||
super(CopyAction.ID, CopyAction.LABEL, CopyAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IChartActionContext): Promise<void> {
|
||||
public override async run(context: IChartActionContext): Promise<void> {
|
||||
if (context.insight instanceof Graph) {
|
||||
let data = context.insight.getCanvasData();
|
||||
if (!data) {
|
||||
@@ -170,7 +170,7 @@ export class SaveImageAction extends Action {
|
||||
super(SaveImageAction.ID, SaveImageAction.LABEL, SaveImageAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IChartActionContext): Promise<void> {
|
||||
public override async run(context: IChartActionContext): Promise<void> {
|
||||
if (context.insight instanceof Graph) {
|
||||
let fileFilters = new Array<FileFilter>({ extensions: ['png'], name: localize('resultsSerializer.saveAsFileExtensionPNGTitle', "PNG") });
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ export class ChartView extends Disposable implements IPanelView {
|
||||
return option.map(o => altNameHash[o] || o);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
dispose(this.optionDisposables);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export class ConfigureChartDialog extends Modal {
|
||||
this.show();
|
||||
}
|
||||
|
||||
public render() {
|
||||
public override render() {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy {
|
||||
return new Array(max).fill(0).map((x, i) => i);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
@@ -283,6 +283,6 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ import { DashboardWidgetWrapper } from 'sql/workbench/contrib/dashboard/browser/
|
||||
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { DASHBOARD_BORDER } from 'vs/workbench/common/theme';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { DASHBOARD_BORDER } from 'sql/workbench/common/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'dashboard-home-container',
|
||||
@@ -53,7 +53,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
|
||||
super(_cd);
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
override ngAfterContentInit() {
|
||||
this.updateTheme(this.themeService.getColorTheme());
|
||||
this._register(this.themeService.onDidColorThemeChange((event: IColorTheme) => {
|
||||
this.updateTheme(event);
|
||||
@@ -90,7 +90,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer {
|
||||
}
|
||||
}
|
||||
|
||||
public refresh(): void {
|
||||
public override refresh(): void {
|
||||
super.refresh();
|
||||
this._propertiesClass.refresh();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
}
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export class DashboardNavSection extends DashboardTab implements OnDestroy, OnCh
|
||||
}
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
if (this._tabs) {
|
||||
this._tabs.forEach(tabContent => {
|
||||
tabContent.enableEdit();
|
||||
|
||||
@@ -66,7 +66,7 @@ export class DashboardWidgetContainer extends DashboardTab implements AfterConte
|
||||
this._widgetContent.refresh();
|
||||
}
|
||||
|
||||
public enableEdit(): void {
|
||||
public override enableEdit(): void {
|
||||
this._widgetContent.enableEdit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { values } from 'vs/base/common/collections';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { DASHBOARD_BORDER } from 'sql/workbench/common/theme';
|
||||
|
||||
const componentMap: { [x: string]: Type<IDashboardWidget> } = {
|
||||
'properties-widget': PropertiesWidgetComponent,
|
||||
@@ -257,7 +258,7 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
|
||||
if (!this._config.hideHeader) {
|
||||
const el = <HTMLElement>this._ref.nativeElement;
|
||||
const headerEl: HTMLElement = this.header.nativeElement;
|
||||
let borderColor = theme.getColor(themeColors.DASHBOARD_BORDER);
|
||||
let borderColor = theme.getColor(DASHBOARD_BORDER);
|
||||
let backgroundColor = theme.getColor(colors.editorBackground, true);
|
||||
const foregroundColor = theme.getColor(themeColors.SIDE_BAR_FOREGROUND, true);
|
||||
const border = theme.getColor(colors.contrastBorder, true);
|
||||
|
||||
@@ -107,7 +107,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
|
||||
this._webview.mountTo(this._el.nativeElement);
|
||||
|
||||
this._onMessageDisposable = this._webview.onMessage(e => {
|
||||
this._onMessage.fire(e);
|
||||
this._onMessage.fire(e.message);
|
||||
});
|
||||
if (this._html) {
|
||||
this._webview.html = this._html;
|
||||
|
||||
@@ -30,7 +30,7 @@ export class EditDashboardAction extends Action {
|
||||
super(EditDashboardAction.ID, EditDashboardAction.EDITLABEL, EditDashboardAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.editFn.apply(this.context);
|
||||
this.toggleLabel();
|
||||
}
|
||||
@@ -59,7 +59,7 @@ export class RefreshWidgetAction extends Action {
|
||||
super(RefreshWidgetAction.ID, RefreshWidgetAction.LABEL, RefreshWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.refreshFn.apply(this.context);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export class ToolbarAction extends Action {
|
||||
super(id, label, cssClass);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
try {
|
||||
this.runFn.apply(this.context, [this.id]);
|
||||
} catch (e) {
|
||||
@@ -99,7 +99,7 @@ export class ToggleMoreWidgetAction extends Action {
|
||||
super(ToggleMoreWidgetAction.ID, ToggleMoreWidgetAction.LABEL, ToggleMoreWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
override async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
this._contextMenuService.showContextMenu({
|
||||
getAnchor: () => context.target,
|
||||
getActions: () => this._actions,
|
||||
@@ -121,7 +121,7 @@ export class DeleteWidgetAction extends Action {
|
||||
super(DeleteWidgetAction.ID, DeleteWidgetAction.LABEL, DeleteWidgetAction.ICON);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this.angularEventService.sendAngularEvent(this._uri, AngularEventType.DELETE_WIDGET, { id: this._widgetId });
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class PinUnpinTabAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
public override async run(): Promise<void> {
|
||||
this._isPinned = !this._isPinned;
|
||||
this.updatePinStatus();
|
||||
this.angularEventService.sendAngularEvent(this._uri, AngularEventType.PINUNPIN_TAB, { tabId: this._tabId, isPinned: this._isPinned });
|
||||
@@ -176,7 +176,7 @@ export class AddFeatureTabAction extends Action {
|
||||
this._register(this._angularEventService.onAngularEvent(this._uri)(event => this.handleDashboardEvent(event)));
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this._newDashboardTabService.showDialog(this._dashboardTabs, this._openedTabs, this._uri);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export class CollapseWidgetAction extends Action {
|
||||
this.expanded = !this.collpasedState;
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
this._toggleState();
|
||||
this._angularEventService.sendAngularEvent(this._uri, AngularEventType.COLLAPSE_WIDGET, this._widgetUuid);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import * as nls from 'vs/nls';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { Action, IAction, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { Action, IAction, SubmenuAction } from 'vs/base/common/actions';
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
@@ -47,11 +47,13 @@ import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewIt
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { NAV_SECTION } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardNavSection.contribution';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { DASHBOARD_BORDER, EDITOR_PANE_BACKGROUND, TOOLBAR_OVERFLOW_SHADOW } from 'vs/workbench/common/theme';
|
||||
import { EDITOR_PANE_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IColorTheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { attachTabbedPanelStyler } from 'sql/workbench/common/styler';
|
||||
import { focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { LabeledMenuItemActionItem } from 'sql/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { DASHBOARD_BORDER, TOOLBAR_OVERFLOW_SHADOW } from 'sql/workbench/common/theme';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
const dashboardRegistry = Registry.as<IDashboardRegistry>(DashboardExtensions.DashboardContributions);
|
||||
const homeTabGroupId = 'home';
|
||||
@@ -179,7 +181,7 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig
|
||||
let secondary: IAction[] = [];
|
||||
const menu = this.menuService.createMenu(MenuId.DashboardToolbar, this.contextKeyService);
|
||||
let groups = menu.getActions({ arg: this.connectionManagementService.connectionInfo.connectionProfile.toIConnectionProfile(), shouldForwardArgs: true });
|
||||
fillInActions(groups, { primary, secondary }, false, (group: string) => group === undefined || group === '');
|
||||
fillInActions(groups, { primary, secondary }, false, '', Number.MAX_SAFE_INTEGER, (action: SubmenuAction, group: string, groupSize: number) => group === undefined || group === '');
|
||||
|
||||
primary.forEach(a => {
|
||||
if (a instanceof MenuItemAction) {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { DASHBOARD_WIDGET_TITLE, DASHBOARD_WIDGET_SUBTEXT } from 'sql/workbench/common/theme';
|
||||
import 'vs/css!./dashboardPanel';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { DASHBOARD_WIDGET_SUBTEXT, DASHBOARD_WIDGET_TITLE } from 'vs/workbench/common/theme';
|
||||
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
// widget title
|
||||
|
||||
@@ -10,7 +10,6 @@ import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||
import { SingleConnectionManagementService } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
|
||||
|
||||
export abstract class DashboardTab extends TabChild {
|
||||
public abstract layout(): void;
|
||||
public abstract readonly id: string;
|
||||
public abstract readonly editable: boolean;
|
||||
public abstract refresh(): void;
|
||||
|
||||
@@ -7,7 +7,8 @@ import { DashboardEditor } from 'sql/workbench/contrib/dashboard/browser/dashboa
|
||||
import { DashboardInput } from 'sql/workbench/browser/editor/profiler/dashboardInput';
|
||||
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { EditorDescriptor, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationNode, IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
@@ -72,7 +72,7 @@ export class OEManageConnectionAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(actionContext: ObjectExplorerActionsContext): Promise<void> {
|
||||
override async run(actionContext: ObjectExplorerActionsContext): Promise<void> {
|
||||
this._treeSelectionHandler = this._instantiationService.createInstance(TreeSelectionHandler);
|
||||
this._treeSelectionHandler.onTreeActionStateChange(true);
|
||||
try {
|
||||
@@ -124,7 +124,7 @@ export class OEManageConnectionAction extends Action {
|
||||
this._treeSelectionHandler.onTreeActionStateChange(false);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
override dispose(): void {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class DashboardEditor extends EditorPane {
|
||||
|
||||
public static ID: string = 'workbench.editor.connectiondashboard';
|
||||
private _dashboardContainer: HTMLElement;
|
||||
protected _input: DashboardInput;
|
||||
protected override _input: DashboardInput;
|
||||
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@@ -44,7 +44,7 @@ export class DashboardEditor extends EditorPane {
|
||||
super(DashboardEditor.ID, telemetryService, themeService, storageService);
|
||||
}
|
||||
|
||||
public get input(): DashboardInput {
|
||||
public override get input(): DashboardInput {
|
||||
return this._input;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export class DashboardEditor extends EditorPane {
|
||||
/**
|
||||
* Sets focus on this editor. Specifically, it sets the focus on the hosted text editor.
|
||||
*/
|
||||
public focus(): void {
|
||||
public override focus(): void {
|
||||
|
||||
let profile: IConnectionProfile;
|
||||
if (this.input.connectionProfile instanceof ConnectionProfile) {
|
||||
@@ -77,7 +77,7 @@ export class DashboardEditor extends EditorPane {
|
||||
this._dashboardService.layout(dimension);
|
||||
}
|
||||
|
||||
public async setInput(input: DashboardInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
public override async setInput(input: DashboardInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
if (this.input && this.input.matches(input)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@@ -135,7 +135,7 @@ export class DashboardEditor extends EditorPane {
|
||||
input.setUniqueSelector(uniqueSelector);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IAngularEventingService } from 'sql/platform/angularEventing/browser/an
|
||||
import { ExecuteCommandAction } from 'vs/platform/actions/common/actions';
|
||||
|
||||
export class ExplorerManageAction extends ManageAction {
|
||||
public static readonly ID = 'explorerwidget.manage';
|
||||
public static override readonly ID = 'explorerwidget.manage';
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
|
||||
@@ -18,13 +18,13 @@ export class ExplorerManageAction extends ManageAction {
|
||||
super(id, label, connectionManagementService, angularEventingService);
|
||||
}
|
||||
|
||||
public async run(actionContext: ManageActionContext): Promise<void> {
|
||||
public override async run(actionContext: ManageActionContext): Promise<void> {
|
||||
await super.run(actionContext);
|
||||
}
|
||||
}
|
||||
|
||||
export class CustomExecuteCommandAction extends ExecuteCommandAction {
|
||||
run(context: ManageActionContext): Promise<any> {
|
||||
override run(context: ManageActionContext): Promise<any> {
|
||||
return super.run(context.profile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ export class ExplorerTable extends Disposable {
|
||||
const primary: IAction[] = [];
|
||||
const secondary: IAction[] = [];
|
||||
const result = { primary, secondary };
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, g => g === 'inline');
|
||||
createAndFillInContextMenuActions(menu, { shouldForwardArgs: true }, result, 'inline');
|
||||
|
||||
this.contextMenuService.showContextMenu({
|
||||
getAnchor: () => anchor,
|
||||
|
||||
@@ -46,7 +46,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private readonly _bootstrap: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => Router)) private readonly _router: Router,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ElementRef)) private readonly _el: ElementRef,
|
||||
@Inject(IWorkbenchThemeService) private readonly themeService: IWorkbenchThemeService,
|
||||
@Inject(IContextViewService) private readonly contextViewService: IContextViewService,
|
||||
@@ -60,6 +60,7 @@ export class ExplorerWidget extends DashboardWidget implements IDashboardWidget,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this._loadingMessage = this._config.context === 'database' ? nls.localize('loadingObjects', "loading objects") : nls.localize('loadingDatabases', "loading databases");
|
||||
this._loadingCompletedMessage = this._config.context === 'database' ? nls.localize('loadingObjectsCompleted', "loading objects completed.") : nls.localize('loadingDatabasesCompleted', "loading databases completed.");
|
||||
this.init();
|
||||
|
||||
@@ -24,7 +24,7 @@ export class RunInsightQueryAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(context: InsightActionContext): Promise<void> {
|
||||
public override async run(context: InsightActionContext): Promise<void> {
|
||||
let queryString: string = undefined;
|
||||
let eol: string = this._textResourcePropertiesService.getEOL(undefined);
|
||||
if (context.insight && context.insight.query) {
|
||||
|
||||
@@ -71,7 +71,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ComponentFactoryResolver)) private _componentFactoryResolver: ComponentFactoryResolver,
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private dashboardService: CommonServiceInterface,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => Injector)) private _injector: Injector,
|
||||
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
|
||||
@@ -164,7 +164,7 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
get actions(): Array<Action> {
|
||||
override get actions(): Array<Action> {
|
||||
const actions: Array<Action> = [];
|
||||
if (this.insightConfig.details && (this.insightConfig.details.query || this.insightConfig.details.queryFile)) {
|
||||
actions.push(this.instantiationService.createInstance(InsightAction, InsightAction.ID, InsightAction.LABEL));
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class BarChart extends ChartInsight {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
public setConfig(config: IBarChartConfig): void {
|
||||
public override setConfig(config: IBarChartConfig): void {
|
||||
let options = {};
|
||||
if (config.xAxisMax) {
|
||||
const opts = {
|
||||
@@ -127,7 +127,7 @@ export default class BarChart extends ChartInsight {
|
||||
super.setConfig(config);
|
||||
}
|
||||
|
||||
protected updateTheme(e: IColorTheme): void {
|
||||
protected override updateTheme(e: IColorTheme): void {
|
||||
super.updateTheme(e);
|
||||
const foregroundColor = e.getColor(colors.editorForeground);
|
||||
const foreground = foregroundColor ? foregroundColor.toString() : null;
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
|
||||
export default class DoughnutChart extends PieChart {
|
||||
protected readonly chartType: ChartType = ChartType.Doughnut;
|
||||
protected override readonly chartType: ChartType = ChartType.Doughnut;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
|
||||
export default class HorizontalBarChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.HorizontalBar;
|
||||
protected override readonly chartType: ChartType = ChartType.HorizontalBar;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -21,9 +21,9 @@ export interface ILineConfig extends IBarChartConfig {
|
||||
const defaultLineConfig = mixin(deepClone(defaultChartConfig), { dataType: 'number' }) as ILineConfig;
|
||||
|
||||
export default class LineChart extends BarChart {
|
||||
protected readonly chartType: ChartType = ChartType.Line;
|
||||
protected _config: ILineConfig;
|
||||
protected _defaultConfig = defaultLineConfig;
|
||||
protected override readonly chartType: ChartType = ChartType.Line;
|
||||
protected override _config: ILineConfig;
|
||||
protected override _defaultConfig = defaultLineConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@@ -33,14 +33,14 @@ export default class LineChart extends BarChart {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
public init() {
|
||||
public override init() {
|
||||
if (this._config.dataType === DataType.Point) {
|
||||
this.addAxisLabels();
|
||||
}
|
||||
super.init();
|
||||
}
|
||||
|
||||
public get chartData(): Array<IDataSet | IPointDataSet> {
|
||||
public override get chartData(): Array<IDataSet | IPointDataSet> {
|
||||
if (this._config.dataType === DataType.Number) {
|
||||
return super.getChartData();
|
||||
} else {
|
||||
@@ -48,7 +48,7 @@ export default class LineChart extends BarChart {
|
||||
}
|
||||
}
|
||||
|
||||
protected clearMemoize() {
|
||||
protected override clearMemoize() {
|
||||
super.clearMemoize();
|
||||
LineChart.MEMOIZER.clear();
|
||||
}
|
||||
@@ -68,7 +68,7 @@ export default class LineChart extends BarChart {
|
||||
return values(dataSetMap);
|
||||
}
|
||||
|
||||
public get labels(): Array<string> {
|
||||
public override get labels(): Array<string> {
|
||||
if (this._config.dataType === DataType.Number) {
|
||||
return super.getLabels();
|
||||
} else {
|
||||
|
||||
@@ -15,8 +15,8 @@ import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
|
||||
const defaultScatterConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class ScatterChart extends LineChart {
|
||||
protected readonly chartType: ChartType = ChartType.Scatter;
|
||||
protected _defaultConfig = defaultScatterConfig;
|
||||
protected override readonly chartType: ChartType = ChartType.Scatter;
|
||||
protected override _defaultConfig = defaultScatterConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
|
||||
@@ -18,7 +18,7 @@ import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
const defaultTimeSeriesConfig = mixin(deepClone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
export default class TimeSeriesChart extends LineChart {
|
||||
protected _defaultConfig = defaultTimeSeriesConfig;
|
||||
protected override _defaultConfig = defaultTimeSeriesConfig;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
|
||||
@@ -28,7 +28,7 @@ export default class TimeSeriesChart extends LineChart {
|
||||
super(_changeRef, themeService, telemetryService);
|
||||
}
|
||||
|
||||
protected addAxisLabels(): void {
|
||||
protected override addAxisLabels(): void {
|
||||
const xLabel = this._config.xAxisLabel || this.getLabels()[1] || 'x';
|
||||
const yLabel = this._config.yAxisLabel || this.getLabels()[2] || 'y';
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class TimeSeriesChart extends LineChart {
|
||||
this.options = assign({}, mixin(this.options, options));
|
||||
}
|
||||
|
||||
protected getDataAsPoint(): Array<IPointDataSet> {
|
||||
protected override getDataAsPoint(): Array<IPointDataSet> {
|
||||
const dataSetMap: { [label: string]: IPointDataSet } = {};
|
||||
this._data.rows.map(row => {
|
||||
if (row && row.length >= 3) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { subscriptionToDisposable } from 'sql/base/browser/lifecycle';
|
||||
import { PropertiesContainer, PropertyItem } from 'sql/base/browser/ui/propertiesContainer/propertiesContainer.component';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { PROPERTIES_CONTAINER_PROPERTY_NAME, PROPERTIES_CONTAINER_PROPERTY_VALUE } from 'vs/workbench/common/theme';
|
||||
import { PROPERTIES_CONTAINER_PROPERTY_NAME, PROPERTIES_CONTAINER_PROPERTY_VALUE } from 'sql/workbench/common/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'properties-widget',
|
||||
@@ -34,10 +34,11 @@ export class PropertiesWidgetComponent extends DashboardWidget implements IDashb
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrap: CommonServiceInterface,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
|
||||
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(ILogService) private logService: ILogService
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,13 +38,14 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => CommonServiceInterface)) private readonly _dashboardService: DashboardServiceInterface,
|
||||
@Inject(WIDGET_CONFIG) protected readonly _config: WidgetConfig,
|
||||
@Inject(WIDGET_CONFIG) _config: WidgetConfig,
|
||||
@Inject(forwardRef(() => ElementRef)) private readonly _el: ElementRef,
|
||||
@Inject(IDashboardViewService) private readonly dashboardViewService: IDashboardViewService,
|
||||
@Inject(IWebviewService) private readonly webviewService: IWebviewService,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef
|
||||
) {
|
||||
super(changeRef);
|
||||
this._config = _config;
|
||||
this._id = (_config.widget[selector] as IWebviewWidgetConfig).id;
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
|
||||
|
||||
this._webview.mountTo(this._el.nativeElement);
|
||||
this._onMessageDisposable = this._webview.onMessage(e => {
|
||||
this._onMessage.fire(e);
|
||||
this._onMessage.fire(e.message);
|
||||
});
|
||||
if (this._html) {
|
||||
this._webview.html = this._html;
|
||||
|
||||
@@ -94,7 +94,7 @@ suite('Dashboard Properties Widget Tests', () => {
|
||||
dashboardService.setup(x => x.connectionManagementService).returns(() => singleConnectionService.object);
|
||||
|
||||
const testLogService = new class extends NullLogService {
|
||||
error() {
|
||||
override error() {
|
||||
assert.fail('Called console Error unexpectedly');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,12 +38,12 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
@IObjectExplorerService private readonly objectExplorerService: IObjectExplorerService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IOpenerService protected openerService: IOpenerService,
|
||||
@IThemeService protected themeService: IThemeService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, opener, themeService, telemetryService);
|
||||
super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
||||
this._serverTreeView = this.objectExplorerService.getServerTreeView() as ServerTreeView;
|
||||
if (!this._serverTreeView) {
|
||||
this._serverTreeView = this.instantiationService.createInstance(ServerTreeView);
|
||||
@@ -51,15 +51,15 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
}
|
||||
}
|
||||
|
||||
protected renderHeader(container: HTMLElement): void {
|
||||
protected override renderHeader(container: HTMLElement): void {
|
||||
super.renderHeader(container);
|
||||
}
|
||||
|
||||
renderHeaderTitle(container: HTMLElement): void {
|
||||
override renderHeaderTitle(container: HTMLElement): void {
|
||||
super.renderHeaderTitle(container, this.options.title);
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
override renderBody(container: HTMLElement): void {
|
||||
const viewletContainer = DOM.append(container, DOM.$('div.server-explorer-viewlet'));
|
||||
const viewContainer = DOM.append(viewletContainer, DOM.$('div.object-explorer-view'));
|
||||
this._serverTreeView.renderBody(viewContainer).then(undefined, error => {
|
||||
@@ -72,7 +72,7 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
return this._serverTreeView.tree;
|
||||
}
|
||||
|
||||
layoutBody(size: number): void {
|
||||
override layoutBody(size: number): void {
|
||||
this._serverTreeView.layout(size);
|
||||
DOM.toggleClass(this._root!, 'narrow', this._root!.clientWidth < 300);
|
||||
}
|
||||
@@ -111,11 +111,11 @@ export class ConnectionViewletPanel extends ViewPane {
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
override dispose(): void {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
override focus(): void {
|
||||
super.focus();
|
||||
this._serverTreeView.tree.domFocus();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPane';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { SqlIconId } from 'sql/base/common/codicons';
|
||||
|
||||
@@ -55,22 +54,6 @@ export class DataExplorerViewletViewsContribution implements IWorkbenchContribut
|
||||
}
|
||||
}
|
||||
|
||||
export class DataExplorerViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(DataExplorerViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class DataExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
private root?: HTMLElement;
|
||||
|
||||
@@ -91,26 +74,22 @@ export class DataExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
|
||||
}
|
||||
|
||||
create(parent: HTMLElement): void {
|
||||
override create(parent: HTMLElement): void {
|
||||
this.root = parent;
|
||||
|
||||
super.create(parent);
|
||||
parent.classList.add('dataExplorer-viewlet');
|
||||
}
|
||||
|
||||
public updateStyles(): void {
|
||||
super.updateStyles();
|
||||
override focus(): void {
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
}
|
||||
|
||||
layout(dimension: Dimension): void {
|
||||
override layout(dimension: Dimension): void {
|
||||
toggleClass(this.root!, 'narrow', dimension.width <= 300);
|
||||
super.layout(new Dimension(dimension.width, dimension.height));
|
||||
}
|
||||
|
||||
getOptimalWidth(): number {
|
||||
override getOptimalWidth(): number {
|
||||
return 400;
|
||||
}
|
||||
|
||||
@@ -126,7 +105,7 @@ export class DataExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
return actions;
|
||||
}
|
||||
|
||||
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane {
|
||||
protected override createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane {
|
||||
let viewletPanel = this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewPane;
|
||||
this._register(viewletPanel);
|
||||
return viewletPanel;
|
||||
|
||||
@@ -7,16 +7,20 @@ import * as assert from 'assert';
|
||||
import * as Platform from 'vs/platform/registry/common/platform';
|
||||
import { ViewletDescriptor, Extensions, Viewlet, ViewletRegistry } from 'vs/workbench/browser/viewlet';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
|
||||
suite('Data Explorer Viewlet', () => {
|
||||
|
||||
class DataExplorerTestViewlet extends Viewlet {
|
||||
|
||||
constructor() {
|
||||
super('dataExplorer', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
super('dataExplorer', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
}
|
||||
|
||||
public layout(dimension: any): void {
|
||||
public override layout(dimension: any): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected createViewPaneContainer(parent: HTMLElement): ViewPaneContainer {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ import { EditDataInput } from 'sql/workbench/browser/editData/editDataInput';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { EditDataResultsEditor } from 'sql/workbench/contrib/editData/browser/editDataResultsEditor';
|
||||
import { EditDataResultsInput } from 'sql/workbench/browser/editData/editDataResultsInput';
|
||||
import { EditorDescriptor, IEditorRegistry, Extensions } from 'vs/workbench/browser/editor';
|
||||
import { EditorDescriptor, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
@@ -37,7 +38,7 @@ configurationRegistry.registerConfiguration({
|
||||
}
|
||||
});
|
||||
|
||||
Registry.as<IEditorRegistry>(Extensions.Editors)
|
||||
Registry.as<IEditorRegistry>(EditorExtensions.Editors)
|
||||
.registerEditor(editDataEditorDescriptor, [new SyncDescriptor(EditDataInput)]);
|
||||
|
||||
// Editor
|
||||
@@ -47,7 +48,7 @@ const editDataResultsEditorDescriptor = EditorDescriptor.create(
|
||||
'EditDataResults'
|
||||
);
|
||||
|
||||
Registry.as<IEditorRegistry>(Extensions.Editors)
|
||||
Registry.as<IEditorRegistry>(EditorExtensions.Editors)
|
||||
.registerEditor(editDataResultsEditorDescriptor, [new SyncDescriptor(EditDataResultsInput)]);
|
||||
|
||||
// Keybinding for toggling the query pane
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action, IActionViewItem, IActionRunner } from 'vs/base/common/actions';
|
||||
import { Action, IActionRunner } from 'vs/base/common/actions';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IQueryModelService } from 'sql/workbench/services/query/common/queryModel';
|
||||
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
|
||||
@@ -16,6 +16,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
const $ = dom.$;
|
||||
|
||||
/**
|
||||
@@ -32,11 +33,6 @@ export abstract class EditDataAction extends Action {
|
||||
this.setClass(enabledClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is executed when the button is clicked.
|
||||
*/
|
||||
public abstract run(): Promise<void>;
|
||||
|
||||
protected setClass(enabledClass: string): void {
|
||||
this._classes = [];
|
||||
|
||||
@@ -73,7 +69,7 @@ export class RefreshTableAction extends EditDataAction {
|
||||
this.label = nls.localize('editData.run', "Run");
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
if (this.isConnected(this.editor)) {
|
||||
let input = this.editor.editDataInput;
|
||||
|
||||
@@ -116,7 +112,7 @@ export class StopRefreshTableAction extends EditDataAction {
|
||||
this.label = nls.localize('editData.stop', "Stop");
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
let input = this.editor.editDataInput;
|
||||
this._queryModelService.disposeEdit(input.uri);
|
||||
return Promise.resolve(null);
|
||||
@@ -139,7 +135,7 @@ export class ChangeMaxRowsAction extends EditDataAction {
|
||||
this.class = ChangeMaxRowsAction.EnabledClass;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
@@ -249,7 +245,7 @@ export class ShowQueryPaneAction extends EditDataAction {
|
||||
}
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
this.editor.toggleQueryPane();
|
||||
this.updateLabel(this.editor.queryPaneEnabled());
|
||||
return Promise.resolve(null);
|
||||
|
||||
@@ -20,7 +20,7 @@ import { EditDataInput } from 'sql/workbench/browser/editData/editDataInput';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import * as queryContext from 'sql/workbench/contrib/query/common/queryContext';
|
||||
import { Taskbar, ITaskbarContent } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { IAction, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IQueryModelService } from 'sql/workbench/services/query/common/queryModel';
|
||||
import { IEditorDescriptorService } from 'sql/workbench/services/queryEditor/browser/editorDescriptorService';
|
||||
import {
|
||||
@@ -37,6 +37,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
/**
|
||||
* Editor that hosts an action bar and a resultSetInput for an edit data session
|
||||
@@ -113,7 +114,7 @@ export class EditDataEditor extends EditorPane {
|
||||
* Called to indicate to the editor that the input should be cleared and resources associated with the
|
||||
* input should be freed.
|
||||
*/
|
||||
public clearInput(): void {
|
||||
public override clearInput(): void {
|
||||
if (this._resultsEditor) {
|
||||
this._resultsEditor.clearInput();
|
||||
}
|
||||
@@ -134,7 +135,7 @@ export class EditDataEditor extends EditorPane {
|
||||
this._createTaskbar(parent);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
this._disposeEditors();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -142,13 +143,13 @@ export class EditDataEditor extends EditorPane {
|
||||
/**
|
||||
* Sets focus on this editor. Specifically, it sets the focus on the hosted text editor.
|
||||
*/
|
||||
public focus(): void {
|
||||
public override focus(): void {
|
||||
if (this._sqlEditor) {
|
||||
this._sqlEditor.focus();
|
||||
}
|
||||
}
|
||||
|
||||
public getControl(): IEditorControl {
|
||||
public override getControl(): IEditorControl {
|
||||
if (this._sqlEditor) {
|
||||
return this._sqlEditor.getControl();
|
||||
}
|
||||
@@ -196,7 +197,7 @@ export class EditDataEditor extends EditorPane {
|
||||
/**
|
||||
* Sets this editor and the sub-editors to visible.
|
||||
*/
|
||||
public setEditorVisible(visible: boolean, group: IEditorGroup): void {
|
||||
public override setEditorVisible(visible: boolean, group: IEditorGroup): void {
|
||||
if (this._resultsEditor) {
|
||||
this._resultsEditor.setVisible(visible, group);
|
||||
}
|
||||
@@ -213,7 +214,7 @@ export class EditDataEditor extends EditorPane {
|
||||
/**
|
||||
* Sets the input data for this editor.
|
||||
*/
|
||||
public setInput(newInput: EditDataInput, options?: EditorOptions, context?: IEditorOpenContext): Promise<void> {
|
||||
public override setInput(newInput: EditDataInput, options?: EditorOptions, context?: IEditorOpenContext): Promise<void> {
|
||||
let oldInput = <EditDataInput>this.input;
|
||||
if (!newInput.setup) {
|
||||
this._initialized = false;
|
||||
@@ -301,7 +302,7 @@ export class EditDataEditor extends EditorPane {
|
||||
}
|
||||
|
||||
|
||||
updateStyles() {
|
||||
override updateStyles() {
|
||||
if (this._resultsEditorContainer) {
|
||||
this._resultsEditorContainer.style.borderTopColor = this.getColor(PANEL_BORDER);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class EditDataGridActionProvider extends GridActionProvider {
|
||||
/**
|
||||
* Return actions given a click on an edit data grid
|
||||
*/
|
||||
public getGridActions(): IAction[] {
|
||||
public override getGridActions(): IAction[] {
|
||||
let actions: IAction[] = [];
|
||||
actions.push(new DeleteRowAction(DeleteRowAction.ID, DeleteRowAction.LABEL, this._deleteRowCallback));
|
||||
actions.push(new RevertRowAction(RevertRowAction.ID, RevertRowAction.LABEL, this._revertRowCallback));
|
||||
@@ -43,7 +43,7 @@ export class DeleteRowAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(gridInfo: IGridInfo): Promise<void> {
|
||||
public override async run(gridInfo: IGridInfo): Promise<void> {
|
||||
this.callback(gridInfo.rowIndex);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ export class RevertRowAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(gridInfo: IGridInfo): Promise<void> {
|
||||
public override async run(gridInfo: IGridInfo): Promise<void> {
|
||||
this.callback();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
onRestoreViewState: Event<void>,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@INotificationService protected notificationService: INotificationService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IKeybindingService protected keybindingService: IKeybindingService,
|
||||
@IContextKeyService protected contextKeyService: IContextKeyService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService,
|
||||
@IClipboardService protected clipboardService: IClipboardService,
|
||||
@IQueryEditorService protected queryEditorService: IQueryEditorService,
|
||||
@ILogService protected logService: ILogService
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@IQueryEditorService queryEditorService: IQueryEditorService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
super(contextMenuService, keybindingService, contextKeyService, configurationService, clipboardService, queryEditorService, logService);
|
||||
this.nativeElement = document.createElement('div');
|
||||
@@ -147,7 +147,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
this.dataService.onLoaded();
|
||||
}
|
||||
|
||||
public render(container: HTMLElement): void {
|
||||
public override render(container: HTMLElement): void {
|
||||
container.appendChild(this.nativeElement);
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ export class EditDataGridPanel extends GridParentComponent {
|
||||
* Force re-rendering of the results grids. Calling this upon unhide (upon focus) fixes UI
|
||||
* glitches that occur when a QueryResultsEditor is hidden then unhidden while it is running a query.
|
||||
*/
|
||||
refreshDatasets(): void {
|
||||
override refreshDatasets(): void {
|
||||
let tempRenderedDataSets = this.renderedDataSets;
|
||||
this.renderedDataSets = [];
|
||||
this.handleChanges({
|
||||
|
||||
@@ -24,7 +24,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
export class EditDataResultsEditor extends EditorPane {
|
||||
|
||||
public static ID: string = 'workbench.editor.editDataResultsEditor';
|
||||
protected _input: EditDataResultsInput;
|
||||
protected override _input: EditDataResultsInput;
|
||||
protected _rawOptions: BareResultsGridInfo;
|
||||
|
||||
private styleSheet = DOM.createStyleSheet();
|
||||
@@ -47,7 +47,7 @@ export class EditDataResultsEditor extends EditorPane {
|
||||
});
|
||||
}
|
||||
|
||||
public get input(): EditDataResultsInput {
|
||||
public override get input(): EditDataResultsInput {
|
||||
return this._input;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export class EditDataResultsEditor extends EditorPane {
|
||||
parent.appendChild(this.styleSheet);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
this.styleSheet = undefined;
|
||||
super.dispose();
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export class EditDataResultsEditor extends EditorPane {
|
||||
public layout(dimension: DOM.Dimension): void {
|
||||
}
|
||||
|
||||
public setInput(input: EditDataResultsInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
public override setInput(input: EditDataResultsInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
super.setInput(input, options, context, CancellationToken.None);
|
||||
this._applySettings();
|
||||
if (!input.hasBootstrapped) {
|
||||
|
||||
@@ -74,7 +74,7 @@ class SaveResultAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(gridInfo: IGridInfo): Promise<void> {
|
||||
public override async run(gridInfo: IGridInfo): Promise<void> {
|
||||
this.dataService.sendSaveRequest({
|
||||
batchIndex: gridInfo.batchIndex,
|
||||
resultSetNumber: gridInfo.resultSetNumber,
|
||||
@@ -100,7 +100,7 @@ class CopyResultAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(gridInfo: IGridInfo): Promise<void> {
|
||||
public override async run(gridInfo: IGridInfo): Promise<void> {
|
||||
this.dataService.copyResults(gridInfo.selection, gridInfo.batchIndex, gridInfo.resultSetNumber, this.copyHeader);
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ class SelectAllGridAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(gridInfo: IGridInfo): Promise<void> {
|
||||
public override async run(gridInfo: IGridInfo): Promise<void> {
|
||||
this.selectAllCallback(gridInfo.gridIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import { IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { IEditorInput, EditorInput, IUntitledTextResourceEditorInput } from 'vs/workbench/common/editor';
|
||||
import { ITextEditorOptions, IEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorGroup, OpenEditorContext } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
|
||||
import { QueryEditorInput } from 'sql/workbench/common/editor/query/queryEditorInput';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -79,7 +79,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined, undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
|
||||
@@ -94,7 +94,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.other'), undefined, undefined, 'sql', undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
|
||||
@@ -109,7 +109,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.notebook'), undefined, undefined, undefined, undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
|
||||
@@ -124,7 +124,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
instantiationService.stub(IEditorService, editorService);
|
||||
const contrib = instantiationService.createInstance(EditorReplacementContribution);
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.iynb'), undefined, undefined, 'notebook', undefined, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
|
||||
@@ -141,7 +141,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.ipynb'), undefined, undefined, undefined, undefined, undefined);
|
||||
const input2 = instantiationService.createInstance(FileEditorInput, URI.file('/test/file2.ipynb'), undefined, undefined, undefined, undefined, undefined);
|
||||
const diffInput = instantiationService.createInstance(DiffEditorInput, undefined, undefined, input, input2, undefined);
|
||||
const response = editorService.fireOpenEditor(diffInput, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(diffInput, undefined, undefined as IEditorGroup);
|
||||
const newinput = await response.override; // our test service returns this so we are fine to cast this
|
||||
assert(newinput instanceof DiffNotebookInput);
|
||||
contrib.dispose();
|
||||
@@ -155,7 +155,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const input = instantiationService.createInstance(FileEditorInput, URI.file('/test/file.sql'), undefined, undefined, undefined, undefined, undefined);
|
||||
const input2 = instantiationService.createInstance(FileEditorInput, URI.file('/test/file2.sql'), undefined, undefined, undefined, undefined, undefined);
|
||||
const diffInput = instantiationService.createInstance(DiffEditorInput, undefined, undefined, input, input2, undefined);
|
||||
const response = editorService.fireOpenEditor(diffInput, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(diffInput, undefined, undefined as IEditorGroup);
|
||||
const newinput = await response.override;
|
||||
assert(newinput instanceof DiffEditorInput);
|
||||
contrib.dispose();
|
||||
@@ -170,7 +170,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const service = accessor.untitledTextEditorService;
|
||||
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response?.override);
|
||||
const newinput = <any>(await response.override) as EditorInput; // our test service returns this so we are fine to cast this
|
||||
|
||||
@@ -188,7 +188,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const untitled = instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
const input = instantiationService.createInstance(UntitledQueryEditorInput, '', untitled, undefined);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response === undefined);
|
||||
|
||||
contrib.dispose();
|
||||
@@ -202,7 +202,7 @@ suite('Editor Replacer Contribution', () => {
|
||||
const accessor = instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
const input = instantiationService.createInstance(UntitledTextEditorInput, service.create({ associatedResource: URI.file('/test/file.unknown') }));
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup, OpenEditorContext.NEW_EDITOR);
|
||||
const response = editorService.fireOpenEditor(input, undefined, undefined as IEditorGroup);
|
||||
assert(response === undefined);
|
||||
|
||||
contrib.dispose();
|
||||
@@ -216,7 +216,7 @@ class MockEditorService extends TestEditorService {
|
||||
}
|
||||
readonly overridenOpens: IOpenEditorOverrideHandler[] = [];
|
||||
|
||||
overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable {
|
||||
override overrideOpenEditor(_handler: IOpenEditorOverrideHandler): IDisposable {
|
||||
this.overridenOpens.push(_handler);
|
||||
return toDisposable(() => {
|
||||
const index = this.overridenOpens.findIndex(v => v === _handler);
|
||||
@@ -226,21 +226,21 @@ class MockEditorService extends TestEditorService {
|
||||
});
|
||||
}
|
||||
|
||||
fireOpenEditor(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions | undefined, group: IEditorGroup, context: OpenEditorContext) {
|
||||
fireOpenEditor(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions | undefined, group: IEditorGroup) {
|
||||
for (const handler of this.overridenOpens) {
|
||||
let response: IOpenEditorOverride | undefined;
|
||||
if (response = handler.open(editor, options, group, context)) {
|
||||
if (response = handler.open(editor, options, group)) {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
openEditor(_editor: any, _options?: any, _group?: any): Promise<any> {
|
||||
override openEditor(_editor: any, _options?: any, _group?: any): Promise<any> {
|
||||
return Promise.resolve(_editor);
|
||||
}
|
||||
|
||||
createEditorInput(_input: IUntitledTextResourceEditorInput): EditorInput {
|
||||
override createEditorInput(_input: IUntitledTextResourceEditorInput): EditorInput {
|
||||
const accessor = this.instantiationService.createInstance(ServiceAccessor);
|
||||
const service = accessor.untitledTextEditorService;
|
||||
return this.instantiationService.createInstance(UntitledTextEditorInput, service.create());
|
||||
|
||||
@@ -25,7 +25,7 @@ export class ShowRecommendedExtensionsByScenarioAction extends Action {
|
||||
super(getScenarioID(scenarioType), localize('showRecommendations', "Show Recommendations"), undefined, true);
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
override run(): Promise<void> {
|
||||
return this.viewletService.openViewlet(VIEWLET_ID, true)
|
||||
.then(viewlet => viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer)
|
||||
.then(viewlet => {
|
||||
@@ -50,7 +50,7 @@ export class InstallRecommendedExtensionsByScenarioAction extends Action {
|
||||
this.recommendations = recommendations;
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
if (!this.recommendations.length) { return; }
|
||||
const viewlet = await this.viewletService.openViewlet(VIEWLET_ID, true);
|
||||
const viewPaneContainer = viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer;
|
||||
@@ -81,7 +81,7 @@ export class OpenExtensionAuthoringDocsAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
await this.openerService.open(URI.parse(OpenExtensionAuthoringDocsAction.extensionAuthoringDocsURI));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On
|
||||
@ViewChild('jobalertsgrid') _gridEl: ElementRef;
|
||||
|
||||
public alerts: azdata.AgentAlertInfo[];
|
||||
public contextAction = NewAlertAction;
|
||||
public override contextAction = NewAlertAction;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@@ -97,7 +97,7 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On
|
||||
this._parentComponent = this._agentViewComponent;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this._didTabChange = true;
|
||||
}
|
||||
|
||||
@@ -196,14 +196,14 @@ export class AlertsViewComponent extends JobManagementView implements OnInit, On
|
||||
this._table.resizeCanvas();
|
||||
}
|
||||
|
||||
protected getTableActions(): IAction[] {
|
||||
protected override getTableActions(): IAction[] {
|
||||
return [
|
||||
this._instantiationService.createInstance(EditAlertAction),
|
||||
this._instantiationService.createInstance(DeleteAlertAction)
|
||||
];
|
||||
}
|
||||
|
||||
protected getCurrentTableObject(rowIndex: number): any {
|
||||
protected override getCurrentTableObject(rowIndex: number): any {
|
||||
let targetObject = {
|
||||
alertInfo: this.alerts && this.alerts.length >= rowIndex ? this.alerts[rowIndex] : undefined
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ export class JobsRefreshAction extends Action {
|
||||
super(JobsRefreshAction.ID, JobsRefreshAction.LABEL, 'refreshIcon');
|
||||
}
|
||||
|
||||
public async run(context?: IJobActionInfo): Promise<void> {
|
||||
public override async run(context?: IJobActionInfo): Promise<void> {
|
||||
context?.component?.refreshJobs();
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export class NewJobAction extends Action {
|
||||
super(NewJobAction.ID, NewJobAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
const component = context.component as JobsViewComponent;
|
||||
await component.openCreateJobDialog();
|
||||
}
|
||||
@@ -81,7 +81,7 @@ export class RunJobAction extends Action {
|
||||
super(RunJobAction.ID, RunJobAction.LABEL, 'start');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
let jobName = context.targetObject.job.name;
|
||||
let ownerUri = context.ownerUri;
|
||||
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
|
||||
@@ -111,7 +111,7 @@ export class StopJobAction extends Action {
|
||||
super(StopJobAction.ID, StopJobAction.LABEL, 'stop');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
let jobName = context.targetObject.name;
|
||||
let ownerUri = context.ownerUri;
|
||||
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
|
||||
@@ -137,7 +137,7 @@ export class EditJobAction extends Action {
|
||||
super(EditJobAction.ID, EditJobAction.LABEL, 'edit');
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
await this._commandService.executeCommand(
|
||||
'agent.openJobDialog',
|
||||
actionInfo.ownerUri,
|
||||
@@ -153,7 +153,7 @@ export class OpenMaterializedNotebookAction extends Action {
|
||||
super(OpenMaterializedNotebookAction.ID, OpenMaterializedNotebookAction.LABEL, 'openNotebook');
|
||||
}
|
||||
|
||||
public async run(context: any): Promise<void> {
|
||||
public override async run(context: any): Promise<void> {
|
||||
context.component.openNotebook(context.history);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ export class DeleteJobAction extends Action {
|
||||
super(DeleteJobAction.ID, DeleteJobAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let job = actionInfo.targetObject.job as azdata.AgentJobInfo;
|
||||
this._notificationService.prompt(
|
||||
Severity.Info,
|
||||
@@ -211,7 +211,7 @@ export class NewStepAction extends Action {
|
||||
super(NewStepAction.ID, NewStepAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: JobHistoryComponent): Promise<void> {
|
||||
public override async run(context: JobHistoryComponent): Promise<void> {
|
||||
let ownerUri = context.ownerUri;
|
||||
let server = context.serverName;
|
||||
let jobInfo = context.agentJobInfo;
|
||||
@@ -233,7 +233,7 @@ export class DeleteStepAction extends Action {
|
||||
super(DeleteStepAction.ID, DeleteStepAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let step = actionInfo.targetObject as azdata.AgentJobStepInfo;
|
||||
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
|
||||
this._notificationService.prompt(
|
||||
@@ -274,7 +274,7 @@ export class NewAlertAction extends Action {
|
||||
super(NewAlertAction.ID, NewAlertAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
let component = context.component as AlertsViewComponent;
|
||||
await component.openCreateAlertDialog();
|
||||
}
|
||||
@@ -290,7 +290,7 @@ export class EditAlertAction extends Action {
|
||||
super(EditAlertAction.ID, EditAlertAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
await this._commandService.executeCommand(
|
||||
'agent.openAlertDialog',
|
||||
actionInfo.ownerUri,
|
||||
@@ -313,7 +313,7 @@ export class DeleteAlertAction extends Action {
|
||||
super(DeleteAlertAction.ID, DeleteAlertAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let alert = actionInfo.targetObject.alertInfo as azdata.AgentAlertInfo;
|
||||
this._notificationService.prompt(
|
||||
Severity.Info,
|
||||
@@ -351,7 +351,7 @@ export class NewOperatorAction extends Action {
|
||||
super(NewOperatorAction.ID, NewOperatorAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
let component = context.component as OperatorsViewComponent;
|
||||
await component.openCreateOperatorDialog();
|
||||
}
|
||||
@@ -367,7 +367,7 @@ export class EditOperatorAction extends Action {
|
||||
super(EditOperatorAction.ID, EditOperatorAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
await this._commandService.executeCommand(
|
||||
'agent.openOperatorDialog',
|
||||
actionInfo.ownerUri,
|
||||
@@ -388,7 +388,7 @@ export class DeleteOperatorAction extends Action {
|
||||
super(DeleteOperatorAction.ID, DeleteOperatorAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let operator = actionInfo.targetObject as azdata.AgentOperatorInfo;
|
||||
this._notificationService.prompt(
|
||||
Severity.Info,
|
||||
@@ -427,7 +427,7 @@ export class NewProxyAction extends Action {
|
||||
super(NewProxyAction.ID, NewProxyAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
const component = context.component as ProxiesViewComponent;
|
||||
component.openCreateProxyDialog();
|
||||
}
|
||||
@@ -444,7 +444,7 @@ export class EditProxyAction extends Action {
|
||||
super(EditProxyAction.ID, EditProxyAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
const result = await this._jobManagementService.getCredentials(actionInfo.ownerUri);
|
||||
if (result && result.credentials) {
|
||||
await this._commandService.executeCommand(
|
||||
@@ -469,7 +469,7 @@ export class DeleteProxyAction extends Action {
|
||||
super(DeleteProxyAction.ID, DeleteProxyAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let proxy = actionInfo.targetObject as azdata.AgentProxyInfo;
|
||||
this._notificationService.prompt(
|
||||
Severity.Info,
|
||||
@@ -507,7 +507,7 @@ export class NewNotebookJobAction extends Action {
|
||||
super(NewNotebookJobAction.ID, NewNotebookJobAction.LABEL, 'newStepIcon');
|
||||
}
|
||||
|
||||
public async run(context: IJobActionInfo): Promise<void> {
|
||||
public override async run(context: IJobActionInfo): Promise<void> {
|
||||
let component = context.component as NotebooksViewComponent;
|
||||
await component.openCreateNotebookDialog();
|
||||
}
|
||||
@@ -523,7 +523,7 @@ export class EditNotebookJobAction extends Action {
|
||||
super(EditNotebookJobAction.ID, EditNotebookJobAction.LABEL, 'edit');
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
await this._commandService.executeCommand(
|
||||
'agent.openNotebookDialog',
|
||||
actionInfo.ownerUri,
|
||||
@@ -539,7 +539,7 @@ export class OpenTemplateNotebookAction extends Action {
|
||||
super(OpenTemplateNotebookAction.ID, OpenTemplateNotebookAction.LABEL, 'opennotebook');
|
||||
}
|
||||
|
||||
public async run(actionInfo: any): Promise<void> {
|
||||
public override async run(actionInfo: any): Promise<void> {
|
||||
actionInfo.component.openTemplateNotebook();
|
||||
}
|
||||
}
|
||||
@@ -558,7 +558,7 @@ export class DeleteNotebookAction extends Action {
|
||||
super(DeleteNotebookAction.ID, DeleteNotebookAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
let notebook = actionInfo.targetObject.job as azdata.AgentNotebookInfo;
|
||||
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
|
||||
this._notificationService.prompt(
|
||||
@@ -596,7 +596,7 @@ export class PinNotebookMaterializedAction extends Action {
|
||||
super(PinNotebookMaterializedAction.ID, PinNotebookMaterializedAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: any): Promise<void> {
|
||||
public override async run(actionInfo: any): Promise<void> {
|
||||
actionInfo.component.toggleNotebookPin(actionInfo.history, true);
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ export class DeleteMaterializedNotebookAction extends Action {
|
||||
super(DeleteMaterializedNotebookAction.ID, DeleteMaterializedNotebookAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: any): Promise<void> {
|
||||
public override async run(actionInfo: any): Promise<void> {
|
||||
actionInfo.component.deleteMaterializedNotebook(actionInfo.history);
|
||||
}
|
||||
}
|
||||
@@ -622,7 +622,7 @@ export class UnpinNotebookMaterializedAction extends Action {
|
||||
super(UnpinNotebookMaterializedAction.ID, UnpinNotebookMaterializedAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: any): Promise<void> {
|
||||
public override async run(actionInfo: any): Promise<void> {
|
||||
actionInfo.component.toggleNotebookPin(actionInfo.history, false);
|
||||
}
|
||||
}
|
||||
@@ -635,7 +635,7 @@ export class RenameNotebookMaterializedAction extends Action {
|
||||
super(RenameNotebookMaterializedAction.ID, RenameNotebookMaterializedAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: any): Promise<void> {
|
||||
public override async run(actionInfo: any): Promise<void> {
|
||||
actionInfo.component.renameNotebook(actionInfo.history);
|
||||
}
|
||||
}
|
||||
@@ -648,7 +648,7 @@ export class OpenLatestRunMaterializedNotebook extends Action {
|
||||
super(OpenLatestRunMaterializedNotebook.ID, OpenLatestRunMaterializedNotebook.LABEL);
|
||||
}
|
||||
|
||||
public async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
public override async run(actionInfo: IJobActionInfo): Promise<void> {
|
||||
actionInfo.component.openLastNRun(actionInfo.targetObject.job, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ export class JobHistoryComponent extends JobManagementView implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
protected initActionBar() {
|
||||
protected override initActionBar() {
|
||||
this._runJobAction = this.instantiationService.createInstance(RunJobAction);
|
||||
this._stopJobAction = this.instantiationService.createInstance(StopJobAction);
|
||||
this._editJobAction = this.instantiationService.createInstance(EditJobAction);
|
||||
|
||||
@@ -27,7 +27,7 @@ export class JobHistoryModel {
|
||||
export class JobHistoryController extends TreeDefaults.DefaultController {
|
||||
private _jobHistories: AgentJobHistoryInfo[];
|
||||
|
||||
protected onLeftClick(tree: tree.ITree, element: JobHistoryRow, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
protected override onLeftClick(tree: tree.ITree, element: JobHistoryRow, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export class JobStepsViewComponent extends JobManagementView implements OnInit,
|
||||
super(commonService, dashboardService, contextMenuService, keybindingService, instantiationService, undefined);
|
||||
}
|
||||
|
||||
ngAfterContentChecked() {
|
||||
override ngAfterContentChecked() {
|
||||
jQuery('.steps-tree .step-column-heading').closest('.monaco-tree-row').addClass('step-column-row');
|
||||
this.layout();
|
||||
this._tree.onDidScroll(() => {
|
||||
|
||||
@@ -27,11 +27,11 @@ export class JobStepsViewModel {
|
||||
|
||||
export class JobStepsViewController extends TreeDefaults.DefaultController {
|
||||
|
||||
protected onLeftClick(tree: tree.ITree, element: JobStepsViewRow, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
protected override onLeftClick(tree: tree.ITree, element: JobStepsViewRow, event: IMouseEvent, origin: string = 'mouse'): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public onContextMenu(tree: tree.ITree, element: JobStepsViewRow, event: tree.ContextMenuEvent): boolean {
|
||||
public override onContextMenu(tree: tree.ITree, element: JobStepsViewRow, event: tree.ContextMenuEvent): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
private jobSteps: { [jobId: string]: azdata.AgentJobStepInfo[]; } = Object.create(null);
|
||||
private jobAlerts: { [jobId: string]: azdata.AgentAlertInfo[]; } = Object.create(null);
|
||||
private jobSchedules: { [jobId: string]: azdata.AgentJobScheduleInfo[]; } = Object.create(null);
|
||||
public contextAction = NewJobAction;
|
||||
public override contextAction = NewJobAction;
|
||||
|
||||
@ViewChild('jobsgrid') _gridEl: ElementRef;
|
||||
|
||||
@@ -131,7 +131,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
this._telemetryService.sendViewEvent(TelemetryView.AgentJobs);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
}
|
||||
|
||||
public layout() {
|
||||
@@ -859,7 +859,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
});
|
||||
}
|
||||
|
||||
protected getTableActions(targetObject: JobActionContext): IAction[] {
|
||||
protected override getTableActions(targetObject: JobActionContext): IAction[] {
|
||||
const editAction = this._instantiationService.createInstance(EditJobAction);
|
||||
const runJobAction = this._instantiationService.createInstance(RunJobAction);
|
||||
if (!targetObject.canEdit) {
|
||||
@@ -906,7 +906,7 @@ export class JobsViewComponent extends JobManagementView implements OnInit, OnDe
|
||||
return result;
|
||||
}
|
||||
|
||||
protected getCurrentTableObject(rowIndex: number): JobActionContext {
|
||||
protected override getCurrentTableObject(rowIndex: number): JobActionContext {
|
||||
let data = this._table.grid.getData() as Slick.DataProvider<IItem>;
|
||||
if (!data || rowIndex >= data.getLength()) {
|
||||
return undefined;
|
||||
|
||||
@@ -262,7 +262,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
}
|
||||
}
|
||||
|
||||
protected initActionBar() {
|
||||
protected override initActionBar() {
|
||||
this._runJobAction = this.instantiationService.createInstance(RunJobAction);
|
||||
this._stopJobAction = this.instantiationService.createInstance(StopJobAction);
|
||||
this._editNotebookJobAction = this.instantiationService.createInstance(EditNotebookJobAction);
|
||||
@@ -402,7 +402,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
if (history.materializedNotebookName && history.materializedNotebookName !== '') {
|
||||
tooltipString = history.materializedNotebookName;
|
||||
}
|
||||
let dateOptions = {
|
||||
let dateOptions: Intl.DateTimeFormatOptions = {
|
||||
weekday: 'long',
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
@@ -494,7 +494,7 @@ export class NotebookHistoryComponent extends JobManagementView implements OnIni
|
||||
}
|
||||
}
|
||||
|
||||
public refreshJobs() {
|
||||
public override refreshJobs() {
|
||||
this._agentViewComponent.refresh = true;
|
||||
this.loadHistory();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
private jobSteps: { [jobId: string]: azdata.AgentJobStepInfo[]; } = Object.create(null);
|
||||
private jobAlerts: { [jobId: string]: azdata.AgentAlertInfo[]; } = Object.create(null);
|
||||
private jobSchedules: { [jobId: string]: azdata.AgentJobScheduleInfo[]; } = Object.create(null);
|
||||
public contextAction = NewNotebookJobAction;
|
||||
public override contextAction = NewNotebookJobAction;
|
||||
|
||||
@ViewChild('notebooksgrid') _gridEl: ElementRef;
|
||||
|
||||
@@ -131,7 +131,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
this._telemetryService.sendViewEvent(TelemetryView.AgentNotebooks);
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
}
|
||||
|
||||
public layout() {
|
||||
@@ -222,7 +222,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
}
|
||||
}
|
||||
|
||||
protected initActionBar() {
|
||||
protected override initActionBar() {
|
||||
let refreshAction = this._instantiationService.createInstance(JobsRefreshAction);
|
||||
let newAction = this._instantiationService.createInstance(NewNotebookJobAction);
|
||||
let taskbar = <HTMLElement>this.actionBarContainer.nativeElement;
|
||||
@@ -895,7 +895,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
});
|
||||
}
|
||||
|
||||
protected getTableActions(targetObject: JobActionContext): IAction[] {
|
||||
protected override getTableActions(targetObject: JobActionContext): IAction[] {
|
||||
const editNotebookAction = this._instantiationService.createInstance(EditNotebookJobAction);
|
||||
const runJobAction = this._instantiationService.createInstance(RunJobAction);
|
||||
const openLatestRunAction = this._instantiationService.createInstance(OpenLatestRunMaterializedNotebook);
|
||||
@@ -941,7 +941,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
return result;
|
||||
}
|
||||
|
||||
protected getCurrentTableObject(rowIndex: number): JobActionContext {
|
||||
protected override getCurrentTableObject(rowIndex: number): JobActionContext {
|
||||
let data = this._table.grid.getData() as Slick.DataProvider<IItem>;
|
||||
if (!data || rowIndex >= data.getLength()) {
|
||||
return undefined;
|
||||
@@ -997,7 +997,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
|
||||
await this._commandService.executeCommand('agent.openNotebookDialog', ownerUri);
|
||||
}
|
||||
|
||||
public async openLastNRun(notebook: azdata.AgentNotebookInfo, n: number, maxVisibleElements: number) {
|
||||
public override async openLastNRun(notebook: azdata.AgentNotebookInfo, n: number, maxVisibleElements: number) {
|
||||
let notebookHistories = this._notebookCacheObject.getNotebookHistory(notebook.jobId);
|
||||
if (notebookHistories && n < notebookHistories.length) {
|
||||
notebookHistories = notebookHistories.sort((h1, h2) => {
|
||||
|
||||
@@ -64,7 +64,7 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit,
|
||||
@ViewChild('operatorsgrid') _gridEl: ElementRef;
|
||||
|
||||
public operators: azdata.AgentOperatorInfo[];
|
||||
public contextAction = NewOperatorAction;
|
||||
public override contextAction = NewOperatorAction;
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
|
||||
@@ -96,7 +96,7 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit,
|
||||
this._parentComponent = this._agentViewComponent;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this._didTabChange = true;
|
||||
}
|
||||
|
||||
@@ -195,14 +195,14 @@ export class OperatorsViewComponent extends JobManagementView implements OnInit,
|
||||
this._table.resizeCanvas();
|
||||
}
|
||||
|
||||
protected getTableActions(): IAction[] {
|
||||
protected override getTableActions(): IAction[] {
|
||||
return [
|
||||
this._instantiationService.createInstance(EditOperatorAction),
|
||||
this._instantiationService.createInstance(DeleteOperatorAction)
|
||||
];
|
||||
}
|
||||
|
||||
protected getCurrentTableObject(rowIndex: number): any {
|
||||
protected override getCurrentTableObject(rowIndex: number): any {
|
||||
return (this.operators && this.operators.length >= rowIndex)
|
||||
? this.operators[rowIndex]
|
||||
: undefined;
|
||||
|
||||
@@ -62,7 +62,7 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O
|
||||
private _proxiesCacheObject: ProxiesCacheObject;
|
||||
|
||||
public proxies: azdata.AgentProxyInfo[];
|
||||
public readonly contextAction = NewProxyAction;
|
||||
public override readonly contextAction = NewProxyAction;
|
||||
|
||||
private _didTabChange: boolean;
|
||||
@ViewChild('proxiesgrid') _gridEl: ElementRef;
|
||||
@@ -97,7 +97,7 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O
|
||||
this._parentComponent = this._agentViewComponent;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this._didTabChange = true;
|
||||
}
|
||||
|
||||
@@ -196,14 +196,14 @@ export class ProxiesViewComponent extends JobManagementView implements OnInit, O
|
||||
this._table.resizeCanvas();
|
||||
}
|
||||
|
||||
protected getTableActions(): IAction[] {
|
||||
protected override getTableActions(): IAction[] {
|
||||
return [
|
||||
this._instantiationService.createInstance(EditProxyAction),
|
||||
this._instantiationService.createInstance(DeleteProxyAction)
|
||||
];
|
||||
}
|
||||
|
||||
protected getCurrentTableObject(rowIndex: number): any {
|
||||
protected override getCurrentTableObject(rowIndex: number): any {
|
||||
return (this.proxies && this.proxies.length >= rowIndex)
|
||||
? this.proxies[rowIndex]
|
||||
: undefined;
|
||||
|
||||
@@ -105,7 +105,7 @@ export default class WebViewComponent extends ComponentBase<WebViewProperties> i
|
||||
}).catch(onUnexpectedError);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
override ngOnDestroy(): void {
|
||||
this.baseDestroy();
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ export default class WebViewComponent extends ComponentBase<WebViewProperties> i
|
||||
|
||||
/// IComponent implementation
|
||||
|
||||
public layout(): void {
|
||||
public override layout(): void {
|
||||
if (this._ready) {
|
||||
this._ready.then(() => {
|
||||
let element = <HTMLElement>this._el.nativeElement;
|
||||
@@ -159,7 +159,7 @@ export default class WebViewComponent extends ComponentBase<WebViewProperties> i
|
||||
this.layout();
|
||||
}
|
||||
|
||||
public setProperties(properties: { [key: string]: any; }): void {
|
||||
public override setProperties(properties: { [key: string]: any; }): void {
|
||||
if (this._ready) {
|
||||
this._ready.then(() => {
|
||||
super.setProperties(properties);
|
||||
|
||||
@@ -94,7 +94,7 @@ export class ImageCalloutDialog extends Modal {
|
||||
return this._selectionComplete.promise;
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
public override render(): void {
|
||||
super.render();
|
||||
attachCalloutDialogStyler(this, this._themeService);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export class LinkCalloutDialog extends Modal {
|
||||
return this._selectionComplete.promise;
|
||||
}
|
||||
|
||||
public render(): void {
|
||||
public override render(): void {
|
||||
super.render();
|
||||
attachCalloutDialogStyler(this, this._themeService);
|
||||
|
||||
@@ -144,13 +144,13 @@ export class LinkCalloutDialog extends Modal {
|
||||
this._register(styler.attachInputBoxStyler(this._linkUrlInputBox, this._themeService));
|
||||
}
|
||||
|
||||
protected onAccept(e?: StandardKeyboardEvent) {
|
||||
protected override onAccept(e?: StandardKeyboardEvent) {
|
||||
// EventHelper.stop() will call preventDefault. Without it, text cell will insert an extra newline when pressing enter on dialog
|
||||
DOM.EventHelper.stop(e, true);
|
||||
this.insert();
|
||||
}
|
||||
|
||||
protected onClose(e?: StandardKeyboardEvent) {
|
||||
protected override onClose(e?: StandardKeyboardEvent) {
|
||||
DOM.EventHelper.stop(e, true);
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class EditCellAction extends ToggleableAction {
|
||||
this.toggle(value);
|
||||
}
|
||||
|
||||
public async run(context: CellContext): Promise<void> {
|
||||
public override async run(context: CellContext): Promise<void> {
|
||||
this.editMode = !this.editMode;
|
||||
context.cell.isEditMode = this.editMode;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ export class ClearCellOutputAction extends CellActionBase {
|
||||
super(id, label, undefined, notificationService);
|
||||
}
|
||||
|
||||
public canRun(context: CellContext): boolean {
|
||||
public override canRun(context: CellContext): boolean {
|
||||
return context.cell && context.cell.cellType === CellTypes.Code;
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ export class RunCellsAction extends CellActionBase {
|
||||
super(id, label, undefined, notificationService);
|
||||
}
|
||||
|
||||
public canRun(context: CellContext): boolean {
|
||||
public override canRun(context: CellContext): boolean {
|
||||
return context.cell && context.cell.cellType === CellTypes.Code;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ export class CollapseCellAction extends CellActionBase {
|
||||
super(id, label, undefined, notificationService);
|
||||
}
|
||||
|
||||
public canRun(context: CellContext): boolean {
|
||||
public override canRun(context: CellContext): boolean {
|
||||
return context.cell && context.cell.cellType === CellTypes.Code;
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ export class ToggleMoreActions extends Action {
|
||||
super(ToggleMoreActions.ID, ToggleMoreActions.LABEL, ToggleMoreActions.ICON);
|
||||
}
|
||||
|
||||
async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
override async run(context: StandardKeyboardEvent): Promise<void> {
|
||||
this._contextMenuService.showContextMenu({
|
||||
getAnchor: () => context.target,
|
||||
getActions: () => this._actions,
|
||||
@@ -368,7 +368,7 @@ export class ParametersCellAction extends CellActionBase {
|
||||
super(id, label, undefined, notificationService);
|
||||
}
|
||||
|
||||
public canRun(context: CellContext): boolean {
|
||||
public override canRun(context: CellContext): boolean {
|
||||
return context.cell?.cellType === CellTypes.Code;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ export class CodeComponent extends CellView implements OnInit, OnChanges {
|
||||
}
|
||||
}
|
||||
|
||||
public getEditor(): QueryTextEditor {
|
||||
public override getEditor(): QueryTextEditor {
|
||||
return this._editor;
|
||||
}
|
||||
|
||||
public hasEditor(): boolean {
|
||||
public override hasEditor(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export abstract class CellActionBase extends Action {
|
||||
return true;
|
||||
}
|
||||
|
||||
public async run(context: CellContext): Promise<void> {
|
||||
public override async run(context: CellContext): Promise<void> {
|
||||
if (hasModelAndCell(context, this.notificationService)) {
|
||||
return this.doRun(context);
|
||||
}
|
||||
@@ -171,7 +171,7 @@ export class RunCellAction extends MultiStateAction<CellExecutionState> {
|
||||
this.ensureContextIsUpdated(context);
|
||||
}
|
||||
|
||||
public async run(context?: CellContext): Promise<void> {
|
||||
public override async run(context?: CellContext): Promise<void> {
|
||||
return this.doRun(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -401,7 +401,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
return this.cellModel && this.cellModel.id === this.activeCellId;
|
||||
}
|
||||
|
||||
public deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void {
|
||||
public override deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void {
|
||||
if (newDecorationsRange) {
|
||||
this._isFindActive = true;
|
||||
if (Array.isArray(newDecorationsRange)) {
|
||||
|
||||
@@ -373,10 +373,8 @@ export class NotebookFindDecorations implements IDisposable {
|
||||
}
|
||||
|
||||
export class NotebookFindMatch extends FindMatch {
|
||||
_findMatchBrand: void;
|
||||
|
||||
public readonly range: NotebookRange;
|
||||
public readonly matches: string[] | null;
|
||||
public override readonly range: NotebookRange;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -384,6 +382,5 @@ export class NotebookFindMatch extends FindMatch {
|
||||
constructor(range: NotebookRange, matches: string[] | null) {
|
||||
super(new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn), matches);
|
||||
this.range = range;
|
||||
this.matches = matches;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ export class NotebookFindModel extends Disposable implements INotebookFindModel
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
this._findArray = [];
|
||||
this._isDisposed = true;
|
||||
|
||||
@@ -31,7 +31,7 @@ export class TransformMarkdownAction extends Action {
|
||||
super(id, label, cssClass);
|
||||
this._tooltip = tooltip;
|
||||
}
|
||||
public async run(context: any): Promise<void> {
|
||||
public override async run(context: any): Promise<void> {
|
||||
if (!context?.cellModel?.showMarkdown && context?.cellModel?.showPreview) {
|
||||
this.transformDocumentCommand();
|
||||
} else {
|
||||
@@ -606,7 +606,7 @@ export class ToggleViewAction extends Action {
|
||||
this._tooltip = tooltip;
|
||||
}
|
||||
|
||||
public async run(context: MarkdownToolbarComponent): Promise<void> {
|
||||
public override async run(context: MarkdownToolbarComponent): Promise<void> {
|
||||
context.removeActiveClassFromModeActions();
|
||||
this.class += ' active';
|
||||
context.cellModel.showPreview = this.showPreview;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Deferred } from 'sql/base/common/promise';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
public static ID: string = 'workbench.editorinputs.DiffNotebookInput';
|
||||
public static override ID: string = 'workbench.editorinputs.DiffNotebookInput';
|
||||
private _notebookService: INotebookService;
|
||||
private _logService: ILogService;
|
||||
|
||||
@@ -32,7 +32,7 @@ export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
this.setupScrollListeners(originalInput, modifiedInput);
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return DiffNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ export class FileNotebookInput extends NotebookInput {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): FileEditorInput {
|
||||
public override get textInput(): FileEditorInput {
|
||||
return super.textInput as FileEditorInput;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export class FileNotebookInput extends NotebookInput {
|
||||
this.textInput.setPreferredMode(mode);
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return FileNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ export class NotebookEditorModel extends EditorModel {
|
||||
let dirty = this.textEditorModel instanceof ResourceEditorModel ? false : this.textEditorModel.isDirty();
|
||||
this.setDirty(dirty);
|
||||
}));
|
||||
this._register(this.textEditorModel.onDidLoad(async (e) => {
|
||||
this._register(this.textEditorModel.onDidResolve(async (e) => {
|
||||
if (this.textEditorModel instanceof TextFileEditorModel) {
|
||||
let model = this.getNotebookModel() as NotebookModel;
|
||||
await model.loadContents(model.trustedMode, true);
|
||||
@@ -253,7 +253,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._textInput;
|
||||
}
|
||||
|
||||
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
public override revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
|
||||
return this._textInput.revert(group, options);
|
||||
}
|
||||
|
||||
@@ -279,14 +279,14 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._contentManager;
|
||||
}
|
||||
|
||||
public getName(): string {
|
||||
public override getName(): string {
|
||||
if (!this._title) {
|
||||
this._title = resources.basenameOrAuthority(this.resource);
|
||||
}
|
||||
return this._title;
|
||||
}
|
||||
|
||||
public isReadonly(): boolean {
|
||||
public override isReadonly(): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,14 +310,14 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._standardKernels;
|
||||
}
|
||||
|
||||
async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
this.updateModel();
|
||||
let input = await this.textInput.save(groupId, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
return input;
|
||||
}
|
||||
|
||||
async saveAs(group: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async saveAs(group: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
this.updateModel();
|
||||
let input = await this.textInput.saveAs(group, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
@@ -362,8 +362,6 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._layoutChanged.fire();
|
||||
}
|
||||
|
||||
public abstract getTypeId(): string;
|
||||
|
||||
get resource(): URI {
|
||||
return this._resource;
|
||||
}
|
||||
@@ -376,7 +374,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._untitledEditorModel = value;
|
||||
}
|
||||
|
||||
async resolve(): Promise<NotebookEditorModel> {
|
||||
override async resolve(): Promise<NotebookEditorModel> {
|
||||
if (!this._modelResolveInProgress) {
|
||||
this._modelResolveInProgress = true;
|
||||
} else {
|
||||
@@ -401,7 +399,8 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
} else {
|
||||
const textEditorModelReference = await this.textModelService.createModelReference(this.resource);
|
||||
textEditorModelReference.object.textEditorModel.onBeforeAttached();
|
||||
textOrUntitledEditorModel = await textEditorModelReference.object.load() as TextFileEditorModel | ResourceEditorModel;
|
||||
await textEditorModelReference.object.resolve();
|
||||
textOrUntitledEditorModel = textEditorModelReference.object as TextFileEditorModel | ResourceEditorModel;
|
||||
}
|
||||
this._model = this._register(this.instantiationService.createInstance(NotebookEditorModel, this.resource, textOrUntitledEditorModel));
|
||||
this.hookDirtyListener(this._model.onDidChangeDirty, () => this._onDidChangeDirty.fire());
|
||||
@@ -440,7 +439,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
if (this._model && this._model.editorModel && this._model.editorModel.textEditorModel) {
|
||||
this._model.editorModel.textEditorModel.onBeforeDetached();
|
||||
}
|
||||
@@ -477,7 +476,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
/**
|
||||
* An editor that is dirty will be asked to be saved once it closes.
|
||||
*/
|
||||
isDirty(): boolean {
|
||||
override isDirty(): boolean {
|
||||
if (this._model) {
|
||||
return this._model.isDirty();
|
||||
} else if (this._textInput) {
|
||||
@@ -500,7 +499,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
this._model.updateModel();
|
||||
}
|
||||
|
||||
public matches(otherInput: any): boolean {
|
||||
public override matches(otherInput: any): boolean {
|
||||
if (otherInput instanceof NotebookInput) {
|
||||
return this.textInput.matches(otherInput.textInput);
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IEditorInputFactoryRegistry, IEditorInput, IEditorInputSerializer, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files';
|
||||
@@ -18,7 +18,7 @@ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import { DiffNotebookInput } from 'sql/workbench/contrib/notebook/browser/models/diffNotebookInput';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactories);
|
||||
const editorInputFactoryRegistry = Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories);
|
||||
|
||||
export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
static readonly languages = [NotebookLanguage.Notebook, NotebookLanguage.Ipynb];
|
||||
@@ -45,9 +45,9 @@ export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
}
|
||||
}
|
||||
|
||||
export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer {
|
||||
serialize(editorInput: FileNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): FileNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
const fileEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as FileEditorInput;
|
||||
return instantiationService.createInstance(FileNotebookInput, fileEditorInput.getName(), fileEditorInput.resource, fileEditorInput);
|
||||
}
|
||||
@@ -65,9 +65,9 @@ export class FileNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
}
|
||||
|
||||
export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
export class UntitledNoteBookEditorInputFactory implements IEditorInputSerializer {
|
||||
serialize(editorInput: UntitledNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export class UntitledNoteBookEditorInputFactory implements IEditorInputFactory {
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputFactory(UntitledTextEditorInput.ID);
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledTextEditorInput;
|
||||
return instantiationService.createInstance(UntitledNotebookInput, untitledEditorInput.getName(), untitledEditorInput.resource, untitledEditorInput);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { FindMatch } from 'vs/editor/common/model';
|
||||
import { NotebookContentChange, INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { NotebookChangeType } from 'sql/workbench/services/notebook/common/contracts';
|
||||
import { repeat } from 'vs/base/common/strings';
|
||||
import { ITextEditorModel } from 'vs/workbench/common/editor';
|
||||
import { ITextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
|
||||
export class NotebookTextFileModel {
|
||||
// save active cell's line/column in editor model for the beginning of the source property
|
||||
|
||||
@@ -26,7 +26,7 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
super(title, resource, textInput, textModelService, instantiationService, notebookService, extensionService);
|
||||
}
|
||||
|
||||
public get textInput(): UntitledTextEditorInput {
|
||||
public override get textInput(): UntitledTextEditorInput {
|
||||
return super.textInput as UntitledTextEditorInput;
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ export class UntitledNotebookInput extends NotebookInput {
|
||||
this.textInput.setMode(mode);
|
||||
}
|
||||
|
||||
isUntitled(): boolean {
|
||||
override isUntitled(): boolean {
|
||||
// Subclasses need to explicitly opt-in to being untitled.
|
||||
return true;
|
||||
}
|
||||
|
||||
public getTypeId(): string {
|
||||
override get typeId(): string {
|
||||
return UntitledNotebookInput.ID;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { IContextMenuService, IContextViewService } from 'vs/platform/contextvie
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { MenuId, IMenuService, MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { IAction, Action, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { IAction, Action, SubmenuAction } from 'vs/base/common/actions';
|
||||
import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
@@ -37,7 +37,6 @@ import { CellModel } from 'sql/workbench/services/notebook/browser/models/cell';
|
||||
import { FileOperationError, FileOperationResult } from 'vs/platform/files/common/files';
|
||||
import { isValidBasename } from 'vs/base/common/extpath';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { createErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
@@ -45,7 +44,7 @@ import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewIt
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
import { isUndefinedOrNull } from 'vs/base/common/types';
|
||||
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
import { getErrorMessage, onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { getErrorMessage, onUnexpectedError, createErrorWithActions } from 'vs/base/common/errors';
|
||||
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';
|
||||
@@ -53,6 +52,7 @@ import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { CellToolbarComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/cellToolbar.component';
|
||||
import { MaskedLabeledMenuItemActionItem } from 'sql/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
export const NOTEBOOK_SELECTOR: string = 'notebook-component';
|
||||
|
||||
@@ -124,7 +124,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
this.initNavSection();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
if (this.notebookService) {
|
||||
this.notebookService.removeNotebookEditor(this);
|
||||
@@ -560,7 +560,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
let secondary: IAction[] = [];
|
||||
let notebookBarMenu = this.menuService.createMenu(MenuId.NotebookToolbar, this.contextKeyService);
|
||||
let groups = notebookBarMenu.getActions({ arg: null, shouldForwardArgs: true });
|
||||
fillInActions(groups, { primary, secondary }, false, (group: string) => group === undefined || group === '');
|
||||
fillInActions(groups, { primary, secondary }, false, '', Number.MAX_SAFE_INTEGER, (action: SubmenuAction, group: string, groupSize: number) => group === undefined || group === '');
|
||||
this.addPrimaryContributedActions(primary);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,16 +3,17 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { EditorDescriptor, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IEditorInputFactoryRegistry, Extensions as EditorInputFactoryExtensions, ActiveEditorContext, IEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IEditorInputFactoryRegistry, ActiveEditorContext, IEditorInput, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
|
||||
import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensions } from 'sql/workbench/services/languageAssociation/common/languageAssociation';
|
||||
import { UntitledNotebookInput } from 'sql/workbench/contrib/notebook/browser/models/untitledNotebookInput';
|
||||
import { FileNotebookInput } from 'sql/workbench/contrib/notebook/browser/models/fileNotebookInput';
|
||||
import { FileNoteBookEditorInputFactory, UntitledNoteBookEditorInputFactory, NotebookEditorInputAssociation } from 'sql/workbench/contrib/notebook/browser/models/notebookInputFactory';
|
||||
import { FileNoteBookEditorInputSerializer, UntitledNoteBookEditorInputFactory, NotebookEditorInputAssociation } from 'sql/workbench/contrib/notebook/browser/models/notebookInputFactory';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionsExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor, registerAction2, MenuRegistry, MenuId, Action2 } from 'vs/platform/actions/common/actions';
|
||||
|
||||
@@ -46,7 +47,6 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } fr
|
||||
import { NotebookThemingContribution } from 'sql/workbench/contrib/notebook/browser/notebookThemingContribution';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode';
|
||||
import { NotebookExplorerViewletViewsContribution } from 'sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet';
|
||||
import 'vs/css!./media/notebook.contribution';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { SearchSortOrder } from 'vs/workbench/services/search/common/search';
|
||||
@@ -55,12 +55,13 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { INotebookManager } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { NotebookExplorerViewletViewsContribution } from 'sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet';
|
||||
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorInputFactoryExtensions.EditorInputFactories)
|
||||
.registerEditorInputFactory(FileNotebookInput.ID, FileNoteBookEditorInputFactory);
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories)
|
||||
.registerEditorInputSerializer(FileNotebookInput.ID, FileNoteBookEditorInputSerializer);
|
||||
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorInputFactoryExtensions.EditorInputFactories)
|
||||
.registerEditorInputFactory(UntitledNotebookInput.ID, UntitledNoteBookEditorInputFactory);
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories)
|
||||
.registerEditorInputSerializer(UntitledNotebookInput.ID, UntitledNoteBookEditorInputFactory);
|
||||
|
||||
Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations)
|
||||
.registerLanguageAssociation(NotebookEditorInputAssociation.languages, NotebookEditorInputAssociation);
|
||||
|
||||
@@ -61,7 +61,7 @@ export class AddCellAction extends Action {
|
||||
) {
|
||||
super(id, label, cssClass);
|
||||
}
|
||||
public async run(context: URI | CellContext): Promise<void> {
|
||||
public override async run(context: URI | CellContext): Promise<void> {
|
||||
let index = 0;
|
||||
if (context instanceof CellContext) {
|
||||
if (context?.model?.cells) {
|
||||
@@ -128,7 +128,7 @@ export class ClearAllOutputsAction extends TooltipFromLabelAction {
|
||||
});
|
||||
}
|
||||
|
||||
public async run(context: URI): Promise<void> {
|
||||
public override async run(context: URI): Promise<void> {
|
||||
const editor = this._notebookService.findNotebookEditor(context);
|
||||
await editor.clearAllOutputs();
|
||||
}
|
||||
@@ -210,7 +210,7 @@ export class TrustedAction extends ToggleableAction {
|
||||
this.toggle(value);
|
||||
}
|
||||
|
||||
public async run(context: URI): Promise<void> {
|
||||
public override async run(context: URI): Promise<void> {
|
||||
const editor = this._notebookService.findNotebookEditor(context);
|
||||
this.trusted = !this.trusted;
|
||||
editor.model.trustedMode = this.trusted;
|
||||
@@ -227,7 +227,7 @@ export class RunAllCellsAction extends Action {
|
||||
) {
|
||||
super(id, label, cssClass);
|
||||
}
|
||||
public async run(context: URI): Promise<void> {
|
||||
public override async run(context: URI): Promise<void> {
|
||||
try {
|
||||
this._telemetryService.sendActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.RunAll);
|
||||
const editor = this._notebookService.findNotebookEditor(context);
|
||||
@@ -269,7 +269,7 @@ export class CollapseCellsAction extends ToggleableAction {
|
||||
this.expanded = !value;
|
||||
}
|
||||
|
||||
public async run(context: URI): Promise<void> {
|
||||
public override async run(context: URI): Promise<void> {
|
||||
const editor = this._notebookService.findNotebookEditor(context);
|
||||
this.setCollapsed(!this.isCollapsed);
|
||||
editor.cells.forEach(cell => {
|
||||
@@ -304,7 +304,7 @@ export class RunParametersAction extends TooltipFromLabelAction {
|
||||
* Once user enters all values it will open the new parameterized notebook
|
||||
* with injected parameters value from the QuickInput
|
||||
*/
|
||||
public async run(context: URI): Promise<void> {
|
||||
public override async run(context: URI): Promise<void> {
|
||||
const editor = this._notebookService.findNotebookEditor(context);
|
||||
// Only run action for kernels that are supported (Python, PySpark, PowerShell)
|
||||
let supportedKernels: string[] = [KernelsLanguage.Python, KernelsLanguage.PowerShell];
|
||||
@@ -686,7 +686,7 @@ export class NewNotebookAction extends Action {
|
||||
this.class = 'notebook-action new-notebook';
|
||||
}
|
||||
|
||||
async run(context?: azdata.ObjectExplorerContext): Promise<void> {
|
||||
override async run(context?: azdata.ObjectExplorerContext): Promise<void> {
|
||||
this._telemetryService.createActionEvent(TelemetryKeys.TelemetryView.Notebook, TelemetryKeys.NbTelemetryAction.NewNotebookFromConnections)
|
||||
.withConnectionInfo(context?.connectionProfile)
|
||||
.send();
|
||||
|
||||
@@ -20,7 +20,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ModelFactory } from 'sql/workbench/services/notebook/browser/models/modelFactory';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
import { IAction, SubmenuAction } from 'vs/base/common/actions';
|
||||
import { IMenuService, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { fillInActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -151,8 +151,7 @@ export class NotebookEditorComponent extends AngularDisposable {
|
||||
let secondary: IAction[] = [];
|
||||
let notebookBarMenu = this.menuService.createMenu(MenuId.NotebookToolbar, this.contextKeyService);
|
||||
let groups = notebookBarMenu.getActions({ arg: null, shouldForwardArgs: true });
|
||||
fillInActions(groups, { primary, secondary }, false, (group: string) => group === undefined || group === '');
|
||||
//this.addPrimaryContributedActions(primary);
|
||||
fillInActions(groups, { primary, secondary }, false, '', Number.MAX_SAFE_INTEGER, (action: SubmenuAction, group: string, groupSize: number) => group === undefined || group === '');
|
||||
}
|
||||
|
||||
private get modelFactory(): IModelFactory {
|
||||
|
||||
@@ -71,7 +71,7 @@ export class NotebookEditor extends EditorPane implements IFindNotebookControlle
|
||||
this._actionMap[ACTION_IDS.FIND_PREVIOUS] = this._instantiationService.createInstance(NotebookFindPreviousAction, this);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
public override dispose(): void {
|
||||
this._toDispose.dispose();
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ export class NotebookEditor extends EditorPane implements IFindNotebookControlle
|
||||
* Sets focus on this editor. Specifically, it sets the focus on the hosted text editor.
|
||||
* An implementation provided here for IFindNotebookController interface.
|
||||
*/
|
||||
public focus(): void {
|
||||
public override focus(): void {
|
||||
//no-op
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ export class NotebookEditor extends EditorPane implements IFindNotebookControlle
|
||||
}
|
||||
}
|
||||
|
||||
public async setInput(input: NotebookInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
public override async setInput(input: NotebookInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
if (this.input && this.input.matches(input)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/la
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IMenuService, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPane';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
@@ -70,22 +69,6 @@ export class NotebookExplorerViewletViewsContribution implements IWorkbenchContr
|
||||
}
|
||||
}
|
||||
|
||||
export class NotebookExplorerViewlet extends Viewlet {
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IStorageService protected storageService: IStorageService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IContextMenuService protected contextMenuService: IContextMenuService,
|
||||
@IExtensionService protected extensionService: IExtensionService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IWorkbenchLayoutService protected layoutService: IWorkbenchLayoutService,
|
||||
@IConfigurationService protected configurationService: IConfigurationService
|
||||
) {
|
||||
super(VIEWLET_ID, instantiationService.createInstance(NotebookExplorerViewPaneContainer), telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService, layoutService, configurationService);
|
||||
}
|
||||
}
|
||||
|
||||
export class NotebookExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
private root: HTMLElement;
|
||||
private static readonly MAX_TEXT_RESULTS = 10000;
|
||||
@@ -119,7 +102,7 @@ export class NotebookExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
this.queryBuilder = this.instantiationService.createInstance(QueryBuilder);
|
||||
}
|
||||
|
||||
create(parent: HTMLElement): void {
|
||||
override create(parent: HTMLElement): void {
|
||||
this.root = parent;
|
||||
super.create(parent);
|
||||
parent.classList.add('notebookExplorer-viewlet');
|
||||
@@ -392,22 +375,17 @@ export class NotebookExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
public updateStyles(): void {
|
||||
super.updateStyles();
|
||||
}
|
||||
|
||||
focus(): void {
|
||||
override focus(): void {
|
||||
super.focus();
|
||||
this.searchWidget.focus(undefined, this.searchConfig.seedOnFocus);
|
||||
}
|
||||
|
||||
layout(dimension: Dimension): void {
|
||||
override layout(dimension: Dimension): void {
|
||||
toggleClass(this.root, 'narrow', dimension.width <= 300);
|
||||
super.layout(new Dimension(dimension.width, dimension.height - getTotalHeight(this.searchWidgetsContainerElement)));
|
||||
}
|
||||
|
||||
getOptimalWidth(): number {
|
||||
override getOptimalWidth(): number {
|
||||
return 400;
|
||||
}
|
||||
|
||||
@@ -423,7 +401,7 @@ export class NotebookExplorerViewPaneContainer extends ViewPaneContainer {
|
||||
return actions;
|
||||
}
|
||||
|
||||
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane {
|
||||
protected override createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewPane {
|
||||
let viewletPanel = this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewPane;
|
||||
this._register(viewletPanel);
|
||||
return viewletPanel;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { SearchView } from 'vs/workbench/contrib/search/browser/searchView';
|
||||
import { SearchLinkButton, SearchView } from 'vs/workbench/contrib/search/browser/searchView';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPane';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -46,6 +46,7 @@ import { Memento } from 'vs/workbench/common/memento';
|
||||
import { SearchUIState } from 'vs/workbench/contrib/search/common/search';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -60,26 +61,27 @@ export class NotebookSearchView extends SearchView {
|
||||
|
||||
constructor(
|
||||
options: IViewPaneOptions,
|
||||
@IFileService readonly fileService: IFileService,
|
||||
@IEditorService readonly editorService: IEditorService,
|
||||
@IProgressService readonly progressService: IProgressService,
|
||||
@INotificationService readonly notificationService: INotificationService,
|
||||
@IDialogService readonly dialogService: IDialogService,
|
||||
@IContextViewService readonly contextViewService: IContextViewService,
|
||||
@IFileService fileService: IFileService,
|
||||
@IEditorService editorService: IEditorService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IProgressService progressService: IProgressService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IDialogService dialogService: IDialogService,
|
||||
@IContextViewService contextViewService: IContextViewService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IWorkspaceContextService readonly contextService: IWorkspaceContextService,
|
||||
@ISearchWorkbenchService readonly searchWorkbenchService: ISearchWorkbenchService,
|
||||
@IContextKeyService readonly contextKeyService: IContextKeyService,
|
||||
@IReplaceService readonly replaceService: IReplaceService,
|
||||
@ITextFileService readonly textFileService: ITextFileService,
|
||||
@IPreferencesService readonly preferencesService: IPreferencesService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@ISearchWorkbenchService searchWorkbenchService: ISearchWorkbenchService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IReplaceService replaceService: IReplaceService,
|
||||
@ITextFileService textFileService: ITextFileService,
|
||||
@IPreferencesService preferencesService: IPreferencesService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@ISearchHistoryService readonly searchHistoryService: ISearchHistoryService,
|
||||
@ISearchHistoryService searchHistoryService: ISearchHistoryService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IMenuService readonly menuService: IMenuService,
|
||||
@IAccessibilityService readonly accessibilityService: IAccessibilityService,
|
||||
@IMenuService menuService: IMenuService,
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@@ -88,7 +90,7 @@ export class NotebookSearchView extends SearchView {
|
||||
@IAdsTelemetryService private _telemetryService: IAdsTelemetryService,
|
||||
) {
|
||||
|
||||
super(options, fileService, editorService, progressService, notificationService, dialogService, contextViewService, instantiationService, viewDescriptorService, configurationService, contextService, searchWorkbenchService, contextKeyService, replaceService, textFileService, preferencesService, themeService, searchHistoryService, contextMenuService, menuService, accessibilityService, keybindingService, storageService, openerService, telemetryService);
|
||||
super(options, fileService, editorService, codeEditorService, progressService, notificationService, dialogService, contextViewService, instantiationService, viewDescriptorService, configurationService, contextService, searchWorkbenchService, contextKeyService, replaceService, textFileService, preferencesService, themeService, searchHistoryService, contextMenuService, menuService, accessibilityService, keybindingService, storageService, openerService, telemetryService);
|
||||
|
||||
this.memento = new Memento(this.id, storageService);
|
||||
this.viewletState = this.memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
||||
@@ -103,7 +105,7 @@ export class NotebookSearchView extends SearchView {
|
||||
this.toggleExpandAction = this._register(this.instantiationService.createInstance(ToggleCollapseAndExpandAction, ToggleCollapseAndExpandAction.ID, ToggleCollapseAndExpandAction.LABEL, collapseDeepestExpandedLevelAction, expandAllAction));
|
||||
}
|
||||
|
||||
protected get searchConfig(): ISearchConfigurationProperties {
|
||||
protected override get searchConfig(): ISearchConfigurationProperties {
|
||||
return this.configurationService.getValue<ISearchConfigurationProperties>('notebookExplorerSearch');
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ export class NotebookSearchView extends SearchView {
|
||||
return this.state !== SearchUIState.Idle;
|
||||
}
|
||||
|
||||
public updateActions(): void {
|
||||
public override updateActions(): void {
|
||||
for (const action of this.viewActions) {
|
||||
action.update();
|
||||
}
|
||||
@@ -137,7 +139,7 @@ export class NotebookSearchView extends SearchView {
|
||||
this.toggleExpandAction];
|
||||
}
|
||||
|
||||
protected onContextMenu(e: ITreeContextMenuEvent<RenderableMatch | null>): void {
|
||||
protected override onContextMenu(e: ITreeContextMenuEvent<RenderableMatch | null>): void {
|
||||
if (!this.contextMenu) {
|
||||
this.contextMenu = this._register(this.menuService.createMenu(MenuId.SearchContext, this.contextKeyService));
|
||||
}
|
||||
@@ -156,7 +158,7 @@ export class NotebookSearchView extends SearchView {
|
||||
});
|
||||
}
|
||||
|
||||
public reLayout(): void {
|
||||
public override reLayout(): void {
|
||||
if (this.isDisposed) {
|
||||
return;
|
||||
}
|
||||
@@ -182,7 +184,7 @@ export class NotebookSearchView extends SearchView {
|
||||
}
|
||||
}
|
||||
|
||||
renderBody(parent: HTMLElement): void {
|
||||
override renderBody(parent: HTMLElement): void {
|
||||
super.callRenderBody(parent);
|
||||
|
||||
this.container = dom.append(parent, dom.$('.search-view'));
|
||||
@@ -201,7 +203,7 @@ export class NotebookSearchView extends SearchView {
|
||||
this.setExpanded(false);
|
||||
}
|
||||
|
||||
protected showSearchWithoutFolderMessage(): void {
|
||||
protected override showSearchWithoutFolderMessage(): void {
|
||||
this.searchWithoutFolderMessageElement = this.clearMessage();
|
||||
|
||||
const textEl = dom.append(this.searchWithoutFolderMessageElement,
|
||||
@@ -210,14 +212,14 @@ export class NotebookSearchView extends SearchView {
|
||||
const openFolderLink = dom.append(textEl,
|
||||
$('a.pointer.prominent', { tabindex: 0 }, nls.localize('openNotebookFolder', "Open Notebooks")));
|
||||
|
||||
this.messageDisposables.push(dom.addDisposableListener(openFolderLink, dom.EventType.CLICK, async (e: MouseEvent) => {
|
||||
this.messageDisposables.add(dom.addDisposableListener(openFolderLink, dom.EventType.CLICK, async (e: MouseEvent) => {
|
||||
dom.EventHelper.stop(e, false);
|
||||
this.commandService.executeCommand('notebook.command.openNotebookFolder');
|
||||
this.setExpanded(false);
|
||||
}));
|
||||
}
|
||||
|
||||
protected createSearchResultsView(container: HTMLElement): void {
|
||||
protected override createSearchResultsView(container: HTMLElement): void {
|
||||
super.createSearchResultsView(container);
|
||||
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
@@ -315,26 +317,16 @@ export class NotebookSearchView extends SearchView {
|
||||
const p = dom.append(messageEl, $('p', undefined, message));
|
||||
|
||||
if (!completed) {
|
||||
const searchAgainLink = dom.append(p, $('a.pointer.prominent', undefined, nls.localize('rerunSearch.message', "Search again")));
|
||||
this.messageDisposables.push(dom.addDisposableListener(searchAgainLink, dom.EventType.CLICK, (e: MouseEvent) => {
|
||||
dom.EventHelper.stop(e, false);
|
||||
this.triggerSearchQueryChange(query, excludePatternText, includePatternText, triggeredOnType, searchWidget);
|
||||
}));
|
||||
// cancel search
|
||||
dom.append(p, $('span', undefined, ' / '));
|
||||
const cancelSearchLink = dom.append(p, $('a.pointer.prominent', undefined, nls.localize('cancelSearch.message', "Cancel Search")));
|
||||
this.messageDisposables.push(dom.addDisposableListener(cancelSearchLink, dom.EventType.CLICK, (e: MouseEvent) => {
|
||||
dom.EventHelper.stop(e, false);
|
||||
this.cancelSearch();
|
||||
}));
|
||||
const searchAgainButton = this.messageDisposables.add(new SearchLinkButton(
|
||||
nls.localize('rerunSearch.message', "Search again"),
|
||||
() => this.triggerQueryChange({ preserveFocus: false })));
|
||||
dom.append(p, searchAgainButton.element);
|
||||
} else if (hasIncludes || hasExcludes) {
|
||||
const searchAgainLink = dom.append(p, $('a.pointer.prominent', { tabindex: 0 }, nls.localize('rerunSearchInAll.message', "Search again in all files")));
|
||||
this.messageDisposables.push(dom.addDisposableListener(searchAgainLink, dom.EventType.CLICK, (e: MouseEvent) => {
|
||||
dom.EventHelper.stop(e, false);
|
||||
}));
|
||||
const searchAgainButton = this.messageDisposables.add(new SearchLinkButton(nls.localize('rerunSearchInAll.message', "Search again in all files"), this.onSearchAgain.bind(this)));
|
||||
dom.append(p, searchAgainButton.element);
|
||||
} else {
|
||||
const openSettingsLink = dom.append(p, $('a.pointer.prominent', { tabindex: 0 }, nls.localize('openSettings.message', "Open Settings")));
|
||||
this.addClickEvents(openSettingsLink, this.onOpenSettings);
|
||||
const openSettingsButton = this.messageDisposables.add(new SearchLinkButton(nls.localize('openSettings.message', "Open Settings"), this.onOpenSettings.bind(this)));
|
||||
dom.append(p, openSettingsButton.element);
|
||||
}
|
||||
|
||||
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY && !this.contextKeyService.getContextKeyValue('bookOpened')) {
|
||||
@@ -391,12 +383,12 @@ export class NotebookSearchView extends SearchView {
|
||||
.then(onComplete, onError);
|
||||
}
|
||||
|
||||
protected async refreshAndUpdateCount(event?: IChangeEvent): Promise<void> {
|
||||
protected override async refreshAndUpdateCount(event?: IChangeEvent): Promise<void> {
|
||||
this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles, false);
|
||||
return this.refreshTree(event);
|
||||
}
|
||||
|
||||
async refreshTree(event?: IChangeEvent): Promise<void> {
|
||||
override async refreshTree(event?: IChangeEvent): Promise<void> {
|
||||
const collapseResults = this.searchConfig.collapseResults;
|
||||
if (!event || event.added || event.removed) {
|
||||
// Refresh whole tree
|
||||
@@ -422,7 +414,7 @@ export class NotebookSearchView extends SearchView {
|
||||
}
|
||||
}
|
||||
|
||||
cancelSearch(focus: boolean = true): boolean {
|
||||
override cancelSearch(focus: boolean = true): boolean {
|
||||
if (this.viewModel.cancelSearch(false)) {
|
||||
return true;
|
||||
}
|
||||
@@ -479,7 +471,7 @@ export class NotebookSearchView extends SearchView {
|
||||
.then(() => undefined, () => undefined);
|
||||
}
|
||||
|
||||
public saveState(): void {
|
||||
public override saveState(): void {
|
||||
const preserveCase = this.viewModel.preserveCase;
|
||||
this.viewletState['query.preserveCase'] = preserveCase;
|
||||
|
||||
@@ -488,7 +480,7 @@ export class NotebookSearchView extends SearchView {
|
||||
ViewPane.prototype.saveState.call(this);
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
override dispose(): void {
|
||||
this.isDisposed = true;
|
||||
this.saveState();
|
||||
this.treeSelectionChangeListener.dispose();
|
||||
@@ -546,7 +538,7 @@ class ToggleCollapseAndExpandAction extends Action {
|
||||
}
|
||||
|
||||
|
||||
async run(): Promise<void> {
|
||||
override async run(): Promise<void> {
|
||||
await this.determineAction().run();
|
||||
}
|
||||
}
|
||||
@@ -568,7 +560,7 @@ class CancelSearchAction extends Action {
|
||||
this.enabled = !!searchView && searchView.isSlowSearch();
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
override run(): Promise<void> {
|
||||
const searchView = getSearchView(this.viewsService);
|
||||
if (searchView) {
|
||||
searchView.cancelSearch();
|
||||
@@ -595,7 +587,7 @@ class ExpandAllAction extends Action {
|
||||
this.enabled = !!searchView && searchView.hasSearchResults();
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
override run(): Promise<void> {
|
||||
const searchView = getSearchView(this.viewsService);
|
||||
if (searchView) {
|
||||
const viewer = searchView.getControl();
|
||||
@@ -624,7 +616,7 @@ class CollapseDeepestExpandedLevelAction extends Action {
|
||||
this.enabled = !!searchView && searchView.hasSearchResults();
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
override run(): Promise<void> {
|
||||
const searchView = getSearchView(this.viewsService);
|
||||
if (searchView) {
|
||||
const viewer = searchView.getControl();
|
||||
@@ -680,7 +672,7 @@ class ClearSearchResultsAction extends Action {
|
||||
this.enabled = !!searchView && searchView.hasSearchResults();
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
override run(): Promise<void> {
|
||||
const searchView = getSearchView(this.viewsService);
|
||||
if (searchView) {
|
||||
searchView.clearSearchResults();
|
||||
|
||||
@@ -10,7 +10,7 @@ import { ICellEditorProvider, INotebookParams, INotebookService, INotebookEditor
|
||||
import { NotebookModel } from 'sql/workbench/services/notebook/browser/models/notebookModel';
|
||||
import * as notebookUtils from 'sql/workbench/services/notebook/browser/models/notebookUtils';
|
||||
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
|
||||
import { Action, IActionViewItem } from 'vs/base/common/actions';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { LabeledMenuItemActionItem } from 'sql/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
@@ -28,6 +28,7 @@ import { IConnectionManagementService } from 'sql/platform/connection/common/con
|
||||
import { NotebookViewsExtension } from 'sql/workbench/services/notebook/browser/notebookViews/notebookViewsExtension';
|
||||
import { INotebookView } from 'sql/workbench/services/notebook/browser/notebookViews/notebookViews';
|
||||
import { NotebookViewsGridComponent } from 'sql/workbench/contrib/notebook/browser/notebookViews/notebookViewsGrid.component';
|
||||
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
|
||||
export const NOTEBOOKVIEWS_SELECTOR: string = 'notebook-view-component';
|
||||
|
||||
@@ -154,7 +155,7 @@ export class NotebookViewComponent extends AngularDisposable implements INoteboo
|
||||
this.doLoad().catch(e => onUnexpectedError(e));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
override ngOnDestroy() {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ class DataResourceTable extends GridTableBase<any> {
|
||||
private cellOutput: azdata.nb.ICellOutput,
|
||||
state: GridTableState,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IEditorService editorService: IEditorService,
|
||||
@IUntitledTextEditorService untitledEditorService: IUntitledTextEditorService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@@ -251,13 +251,13 @@ class DataResourceTable extends GridTableBase<any> {
|
||||
];
|
||||
}
|
||||
|
||||
public get maximumSize(): number {
|
||||
public override get maximumSize(): number {
|
||||
// Overriding action bar size calculation for now.
|
||||
// When we add this back in, we should update this calculation
|
||||
return Math.max(this.maxSize, /* ACTIONBAR_HEIGHT + BOTTOM_PADDING */ 0);
|
||||
}
|
||||
|
||||
public layout(size?: number): void {
|
||||
public override layout(size?: number): void {
|
||||
super.layout(size);
|
||||
|
||||
if (!this._chartContainer) {
|
||||
@@ -557,7 +557,7 @@ export class NotebookChartAction extends ToggleableAction {
|
||||
});
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
this.resourceTable.toggleChartVisibility();
|
||||
this.toggle(!this.state.isOn);
|
||||
if (this.state.isOn) {
|
||||
|
||||
@@ -30,10 +30,10 @@ import { MockQuickInputService } from 'sql/workbench/contrib/notebook/test/commo
|
||||
class TestClientSession extends ClientSessionStub {
|
||||
private _errorState: boolean = false;
|
||||
setErrorState = (value: boolean) => this._errorState = value;
|
||||
get isInErrorState(): boolean {
|
||||
override get isInErrorState(): boolean {
|
||||
return this._errorState;
|
||||
}
|
||||
get kernel(): azdata.nb.IKernel {
|
||||
override get kernel(): azdata.nb.IKernel {
|
||||
return <azdata.nb.IKernel>{
|
||||
name: 'StandardKernel1'
|
||||
};
|
||||
@@ -43,11 +43,11 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
private _clientSession: TestClientSession = new TestClientSession();
|
||||
public kernelChangedEmitter: Emitter<azdata.nb.IKernelChangedArgs> = new Emitter<azdata.nb.IKernelChangedArgs>();
|
||||
|
||||
public get kernelChanged() {
|
||||
public override get kernelChanged() {
|
||||
return this.kernelChangedEmitter.event;
|
||||
}
|
||||
|
||||
public get clientSession(): TestClientSession {
|
||||
public override get clientSession(): TestClientSession {
|
||||
return this._clientSession;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
return [...this._standardKernelsMap.values()].map(x => x.displayName);
|
||||
}
|
||||
|
||||
public get specs(): azdata.nb.IAllKernels | undefined {
|
||||
public override get specs(): azdata.nb.IAllKernels | undefined {
|
||||
return {
|
||||
defaultKernel: 'SpecKernel1',
|
||||
// The name and displayName are set to same value
|
||||
@@ -100,7 +100,7 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
};
|
||||
}
|
||||
|
||||
public getStandardKernelFromName(name: string): IStandardKernelWithProvider {
|
||||
public override getStandardKernelFromName(name: string): IStandardKernelWithProvider {
|
||||
return this._standardKernelsMap.get(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,25 +64,25 @@ class NotebookModelStub extends stubs.NotebookModelStub {
|
||||
private _kernelChangedEmitter = new Emitter<nb.IKernelChangedArgs>();
|
||||
private _onActiveCellChanged = new Emitter<ICellModel>();
|
||||
|
||||
public get contentChanged(): Event<NotebookContentChange> {
|
||||
public override get contentChanged(): Event<NotebookContentChange> {
|
||||
return this.contentChangedEmitter.event;
|
||||
}
|
||||
|
||||
get kernelChanged(): Event<nb.IKernelChangedArgs> {
|
||||
override get kernelChanged(): Event<nb.IKernelChangedArgs> {
|
||||
return this._kernelChangedEmitter.event;
|
||||
}
|
||||
|
||||
get onActiveCellChanged(): Event<ICellModel> {
|
||||
override get onActiveCellChanged(): Event<ICellModel> {
|
||||
return this._onActiveCellChanged.event;
|
||||
}
|
||||
|
||||
updateActiveCell(cell: ICellModel) {
|
||||
override updateActiveCell(cell: ICellModel) {
|
||||
// do nothing.
|
||||
// When relevant a mock is used to intercept this call to do any verifications or run
|
||||
// any code relevant for testing in the context of the test.
|
||||
}
|
||||
|
||||
get activeCell(): ICellModel {
|
||||
override get activeCell(): ICellModel {
|
||||
return <ICellModel>{};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,23 @@ import * as assert from 'assert';
|
||||
import * as Platform from 'vs/platform/registry/common/platform';
|
||||
import { ViewletDescriptor, Extensions, ViewletRegistry, Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { workbenchInstantiationService } from 'sql/workbench/test/workbenchTestServices';
|
||||
import { Extensions as ViewContainerExtensions, IViewDescriptor, IViewsRegistry } from 'vs/workbench/common/views';
|
||||
import { NotebookExplorerViewPaneContainer, NOTEBOOK_VIEW_CONTAINER } from 'sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
|
||||
suite('Notebook Explorer Views', () => {
|
||||
|
||||
class NotebookExplorerTestViewlet extends Viewlet {
|
||||
|
||||
constructor() {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
super('notebookExplorer', instantiationService.createInstance(NotebookExplorerViewPaneContainer), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
super('notebookExplorer', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
}
|
||||
|
||||
public layout(dimension: any): void {
|
||||
public override layout(dimension: any): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected createViewPaneContainer(parent: HTMLElement): ViewPaneContainer {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
|
||||
@@ -62,13 +62,13 @@ suite('Notebook Input', function (): void {
|
||||
testTitle, fileUri, undefined,
|
||||
undefined, instantiationService, mockNotebookService.object, mockExtensionService.object);
|
||||
|
||||
let inputId = fileNotebookInput.getTypeId();
|
||||
let inputId = fileNotebookInput.typeId;
|
||||
assert.strictEqual(inputId, FileNotebookInput.ID);
|
||||
assert.strictEqual(fileNotebookInput.isUntitled(), false, 'File Input should not be untitled');
|
||||
});
|
||||
|
||||
test('Untitled Notebook Input', async function (): Promise<void> {
|
||||
let inputId = untitledNotebookInput.getTypeId();
|
||||
let inputId = untitledNotebookInput.typeId;
|
||||
assert.strictEqual(inputId, UntitledNotebookInput.ID);
|
||||
assert.ok(untitledNotebookInput.isUntitled(), 'Untitled Input should be untitled');
|
||||
});
|
||||
|
||||
@@ -55,12 +55,12 @@ suite('Local Content Manager', function (): void {
|
||||
setup(() => {
|
||||
const instantiationService = new TestInstantiationService();
|
||||
const fileService = new class extends TestFileService {
|
||||
async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
|
||||
override async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
|
||||
const content = await promisify(fs.readFile)(resource.fsPath);
|
||||
|
||||
return { name: ',', size: 0, etag: '', mtime: 0, value: VSBuffer.fromString(content.toString()), resource, ctime: 0 };
|
||||
}
|
||||
async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
|
||||
override async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
|
||||
await pfs.writeFile(resource.fsPath, bufferOrReadable.toString());
|
||||
return { resource: resource, mtime: 0, etag: '', size: 0, name: '', isDirectory: false, ctime: 0, isFile: true, isSymbolicLink: false };
|
||||
}
|
||||
|
||||
@@ -980,7 +980,7 @@ suite('Notebook Editor Model', function (): void {
|
||||
async function createTextEditorModel(self: Mocha.Context): Promise<NotebookEditorModel> {
|
||||
let textFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(self, defaultUri.toString()), 'utf8', undefined);
|
||||
(<TestTextFileEditorModelManager>accessor.textFileService.files).add(textFileEditorModel.resource, textFileEditorModel);
|
||||
await textFileEditorModel.load();
|
||||
await textFileEditorModel.resolve();
|
||||
return new NotebookEditorModel(defaultUri, textFileEditorModel, mockNotebookService.object, testResourcePropertiesService);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
export class NBTestQueryManagementService extends TestQueryManagementService {
|
||||
onHandlerAddedEmitter = new Emitter<string>();
|
||||
onHandlerAdded: Event<string> = this.onHandlerAddedEmitter.event;
|
||||
override onHandlerAdded: Event<string> = this.onHandlerAddedEmitter.event;
|
||||
|
||||
getRegisteredProviders(): string[] {
|
||||
override getRegisteredProviders(): string[] {
|
||||
return ['sql'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { QueryTextEditor } from 'sql/workbench/browser/modelComponents/queryTextEditor';
|
||||
import * as stubs from 'sql/workbench/contrib/notebook/test/stubs';
|
||||
import { INotebookModel, ICellModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { INotebookParams } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -17,17 +17,10 @@ import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServic
|
||||
// Typically you will pass in either editor or the instantiationService parameter.
|
||||
// Leave both undefined when you want the underlying object(s) to have an undefined editor.
|
||||
export class NotebookEditorStub extends stubs.NotebookEditorStub {
|
||||
cellEditors: CellEditorProviderStub[];
|
||||
model: INotebookModel | undefined;
|
||||
cells?: ICellModel[] = [];
|
||||
|
||||
public readonly id: string;
|
||||
|
||||
public readonly modelReady: Promise<INotebookModel>;
|
||||
|
||||
// Normally one needs to provide either the editor or the instantiationService as the constructor parameter
|
||||
constructor({ cellGuid, instantiationService, editor, model, notebookParams }: { cellGuid?: string; instantiationService?: IInstantiationService; editor?: QueryTextEditor; model?: INotebookModel, notebookParams?: INotebookParams } = {}) {
|
||||
super();
|
||||
this.cells = [];
|
||||
this.model = model;
|
||||
this.notebookParams = notebookParams;
|
||||
this.cellEditors = [new CellEditorProviderStub({ cellGuid: cellGuid, instantiationService: instantiationService, editor: editor })];
|
||||
@@ -63,10 +56,10 @@ class CellEditorProviderStub extends stubs.CellEditorProviderStub {
|
||||
}
|
||||
this._cellGuid = cellGuid;
|
||||
}
|
||||
cellGuid(): string {
|
||||
override cellGuid(): string {
|
||||
return this._cellGuid;
|
||||
}
|
||||
getEditor(): QueryTextEditor {
|
||||
override getEditor(): QueryTextEditor {
|
||||
return this._editor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import { UNSAVED_GROUP_ID, mssqlProviderName } from 'sql/platform/connection/com
|
||||
import { $ } from 'vs/base/browser/dom';
|
||||
import { OEManageConnectionAction } from 'sql/workbench/contrib/dashboard/browser/dashboardActions';
|
||||
import { IViewsService, IView, ViewContainerLocation, ViewContainer, IViewPaneContainer } from 'vs/workbench/common/views';
|
||||
import { ConsoleLogService } from 'vs/platform/log/common/log';
|
||||
import { IProgressIndicator } from 'vs/platform/progress/common/progress';
|
||||
import { IPaneComposite } from 'vs/workbench/common/panecomposite';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
@@ -38,6 +37,7 @@ import { TestConfigurationService } from 'sql/platform/connection/test/common/te
|
||||
import { ServerTreeDataSource } from 'sql/workbench/services/objectExplorer/browser/serverTreeDataSource';
|
||||
import { Tree } from 'vs/base/parts/tree/browser/treeImpl';
|
||||
import { AsyncServerTree } from 'sql/workbench/services/objectExplorer/browser/asyncServerTree';
|
||||
import { ConsoleLogger, LogService } from 'vs/platform/log/common/log';
|
||||
|
||||
suite('SQL Connection Tree Action tests', () => {
|
||||
let errorMessageService: TypeMoq.Mock<TestErrorMessageService>;
|
||||
@@ -48,7 +48,7 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
callStack: undefined
|
||||
};
|
||||
let capabilitiesService = new TestCapabilitiesService();
|
||||
const logService = new ConsoleLogService();
|
||||
const logService = new LogService(new ConsoleLogger());
|
||||
|
||||
setup(() => {
|
||||
errorMessageService = TypeMoq.Mock.ofType(TestErrorMessageService, TypeMoq.MockBehavior.Loose);
|
||||
@@ -139,6 +139,9 @@ suite('SQL Connection Tree Action tests', () => {
|
||||
getActiveViewWithId<T extends IView>(id: string): T | null {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
getViewWithId<T extends IView>(id: string): T | null {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
_serviceBrand: undefined;
|
||||
openView<T extends IView>(id: string, focus?: boolean): Promise<T | null> {
|
||||
return Promise.resolve(<T><any>{
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { EditorDescriptor, IEditorRegistry } from 'vs/workbench/browser/editor';
|
||||
import { EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
|
||||
@@ -34,7 +34,7 @@ export class ProfilerConnect extends Action {
|
||||
super(id, label, 'connect');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
this.enabled = false;
|
||||
if (!this._connected) {
|
||||
await this._profilerService.connectSession(input.id);
|
||||
@@ -71,7 +71,7 @@ export class ProfilerStart extends Action {
|
||||
super(id, label, 'sql start');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
input.data.clear();
|
||||
await this._profilerService.startSession(input.id, input.sessionName);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class ProfilerCreate extends Action {
|
||||
super(id, label, 'add');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
return this._profilerService.launchCreateSessionDialog(input);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ export class ProfilerPause extends Action {
|
||||
super(id, label, ProfilerPause.PauseCssClass);
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
await this._profilerService.pauseSession(input.id);
|
||||
this.paused = !this._paused;
|
||||
input.state.change({ isPaused: this.paused, isStopped: false, isRunning: !this.paused });
|
||||
@@ -139,7 +139,7 @@ export class ProfilerStop extends Action {
|
||||
super(id, label, 'sql stop');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
await this._profilerService.stopSession(input.id);
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ export class ProfilerClear extends Action {
|
||||
super(id, label, 'clear-results');
|
||||
}
|
||||
|
||||
async run(input: ProfilerInput): Promise<void> {
|
||||
override async run(input: ProfilerInput): Promise<void> {
|
||||
this._notificationService.prompt(Severity.Warning, nls.localize('profiler.clearDataPrompt', "Are you sure you want to clear the data?"), [
|
||||
{
|
||||
label: nls.localize('profiler.yes', "Yes"),
|
||||
@@ -181,7 +181,7 @@ export class ProfilerAutoScroll extends Action {
|
||||
super(id, label, ProfilerAutoScroll.CheckedCssClass);
|
||||
}
|
||||
|
||||
async run(input: ProfilerInput): Promise<void> {
|
||||
override async run(input: ProfilerInput): Promise<void> {
|
||||
this.checked = !this.checked;
|
||||
this.label = this.checked ? ProfilerAutoScroll.AutoScrollOnText : ProfilerAutoScroll.AutoScrollOffText;
|
||||
this._setClass(this.checked ? ProfilerAutoScroll.CheckedCssClass : '');
|
||||
@@ -199,7 +199,7 @@ export class ProfilerCollapsablePanelAction extends Action {
|
||||
super(id, label, 'codicon-chevron-down');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
this.collapsed = !this._collapsed;
|
||||
input.state.change({ isPanelCollapsed: this._collapsed });
|
||||
}
|
||||
@@ -225,7 +225,7 @@ export class ProfilerEditColumns extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
await this._profilerService.launchColumnEditor(input);
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ export class ProfilerFilterSession extends Action {
|
||||
super(id, label, 'filterLabel');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
this._profilerService.launchFilterSessionDialog(input);
|
||||
}
|
||||
}
|
||||
@@ -320,7 +320,7 @@ export class ProfilerClearSessionFilter extends Action {
|
||||
super(id, label, 'clear-filter');
|
||||
}
|
||||
|
||||
public async run(input: ProfilerInput): Promise<void> {
|
||||
public override async run(input: ProfilerInput): Promise<void> {
|
||||
this._notificationService.prompt(Severity.Warning, nls.localize('profiler.clearFilterPrompt', "Are you sure you want to clear the filters?"), [
|
||||
{
|
||||
label: nls.localize('profiler.yes', "Yes"),
|
||||
|
||||
@@ -445,11 +445,11 @@ export class ProfilerEditor extends EditorPane {
|
||||
return editorContainer;
|
||||
}
|
||||
|
||||
public get input(): ProfilerInput {
|
||||
public override get input(): ProfilerInput {
|
||||
return this._input as ProfilerInput;
|
||||
}
|
||||
|
||||
public setInput(input: ProfilerInput, options?: EditorOptions): Promise<void> {
|
||||
public override setInput(input: ProfilerInput, options?: EditorOptions): Promise<void> {
|
||||
let savedViewState = this._savedTableViewStates.get(input);
|
||||
|
||||
this._profilerEditorContextKey.set(true);
|
||||
@@ -491,7 +491,7 @@ export class ProfilerEditor extends EditorPane {
|
||||
});
|
||||
}
|
||||
|
||||
public clearInput(): void {
|
||||
public override clearInput(): void {
|
||||
this._profilerEditorContextKey.set(false);
|
||||
}
|
||||
|
||||
@@ -615,7 +615,7 @@ export class ProfilerEditor extends EditorPane {
|
||||
}
|
||||
}
|
||||
|
||||
public focus() {
|
||||
public override focus() {
|
||||
this._profilerEditorContextKey.set(true);
|
||||
super.focus();
|
||||
let savedViewState = this._savedTableViewStates.get(this.input);
|
||||
|
||||
@@ -45,18 +45,18 @@ export class ProfilerResourceEditor extends BaseTextEditor {
|
||||
@IStorageService storageService: IStorageService,
|
||||
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IEditorService protected editorService: IEditorService,
|
||||
@IEditorService editorService: IEditorService,
|
||||
@IEditorGroupsService editorGroupService: IEditorGroupsService
|
||||
|
||||
) {
|
||||
super(ProfilerResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, editorService, editorGroupService);
|
||||
}
|
||||
|
||||
public createEditorControl(parent: HTMLElement, configuration: IEditorOptions): editorCommon.IEditor {
|
||||
public override createEditorControl(parent: HTMLElement, configuration: IEditorOptions): editorCommon.IEditor {
|
||||
return this.instantiationService.createInstance(ProfilerResourceCodeEditor, parent, configuration, {});
|
||||
}
|
||||
|
||||
protected getConfigurationOverrides(): IEditorOptions {
|
||||
protected override getConfigurationOverrides(): IEditorOptions {
|
||||
const options = super.getConfigurationOverrides();
|
||||
options.readOnly = true;
|
||||
if (this.input) {
|
||||
@@ -75,18 +75,18 @@ export class ProfilerResourceEditor extends BaseTextEditor {
|
||||
return options;
|
||||
}
|
||||
|
||||
setInput(input: UntitledTextEditorInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
return super.setInput(input, options, context, CancellationToken.None)
|
||||
.then(() => this.input.resolve()
|
||||
.then(editorModel => editorModel.load())
|
||||
.then(editorModel => this.getControl().setModel((<ResourceEditorModel>editorModel).textEditorModel)));
|
||||
override async setInput(input: UntitledTextEditorInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
await super.setInput(input, options, context, CancellationToken.None);
|
||||
const editorModel = await this.input.resolve() as ResourceEditorModel;
|
||||
await editorModel.resolve();
|
||||
this.getControl().setModel(editorModel.textEditorModel);
|
||||
}
|
||||
|
||||
protected getAriaLabel(): string {
|
||||
return nls.localize('profilerTextEditorAriaLabel', "Profiler editor for event text. Readonly");
|
||||
}
|
||||
|
||||
public layout(dimension: DOM.Dimension) {
|
||||
public override layout(dimension: DOM.Dimension) {
|
||||
this.getControl().layout(dimension);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface ProfilerTableViewState {
|
||||
export class ProfilerTableEditor extends EditorPane implements IProfilerController, ITableController {
|
||||
|
||||
public static ID: string = 'workbench.editor.profiler.table';
|
||||
protected _input: ProfilerInput;
|
||||
protected override _input: ProfilerInput;
|
||||
private _profilerTable: Table<Slick.SlickData>;
|
||||
private _columnListener: IDisposable;
|
||||
private _stateListener: IDisposable;
|
||||
@@ -121,7 +121,7 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
);
|
||||
}
|
||||
|
||||
public setInput(input: ProfilerInput): Promise<void> {
|
||||
public override setInput(input: ProfilerInput): Promise<void> {
|
||||
this._showStatusBarItem = true;
|
||||
this._input = input;
|
||||
|
||||
@@ -169,7 +169,7 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
this._updateFinderMatchState();
|
||||
}, er => { });
|
||||
|
||||
this._input.onDispose(() => {
|
||||
this._input.onWillDispose(() => {
|
||||
this._disposeStatusbarItem();
|
||||
});
|
||||
return Promise.resolve(null);
|
||||
@@ -219,7 +219,7 @@ export class ProfilerTableEditor extends EditorPane implements IProfilerControll
|
||||
return this._actionMap[id];
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
public override focus(): void {
|
||||
this._profilerTable.focus();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { getErrorMessage } from 'vs/base/common/errors';
|
||||
import { SaveFormat } from 'sql/workbench/services/query/common/resultSerializer';
|
||||
import { IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations';
|
||||
import { IEncodingSupport } from 'vs/workbench/common/editor';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { getChartMaxRowCount, notifyMaxRowCountExceeded } from 'sql/workbench/contrib/charts/browser/utils';
|
||||
import { IEncodingSupport } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
|
||||
export interface IGridActionContext {
|
||||
gridDataProvider: IGridDataProvider;
|
||||
@@ -71,7 +71,7 @@ export class SaveResultAction extends Action {
|
||||
super(id, label, icon);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
|
||||
const activeEditor = this.editorService.activeEditorPane as unknown as IEncodingSupport;
|
||||
if (typeof activeEditor.getEncoding === 'function' && activeEditor.getEncoding() !== 'utf8') {
|
||||
@@ -111,7 +111,7 @@ export class CopyResultAction extends Action {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
const selection = this.accountForNumberColumn ? mapForNumberColumn(context.selection) : context.selection;
|
||||
await context.gridDataProvider.copyResults(selection, this.copyHeader, context.table.getData());
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export class SelectAllGridAction extends Action {
|
||||
super(SelectAllGridAction.ID, SelectAllGridAction.LABEL);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
context.selectionModel.setSelectedRanges([new Slick.Range(0, 0, context.table.getData().getLength() - 1, context.table.columns.length - 1)]);
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export class MaximizeTableAction extends Action {
|
||||
super(MaximizeTableAction.ID, MaximizeTableAction.LABEL, MaximizeTableAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
context.tableState.maximized = true;
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ export class RestoreTableAction extends Action {
|
||||
super(RestoreTableAction.ID, RestoreTableAction.LABEL, RestoreTableAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
context.tableState.maximized = false;
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ export class ChartDataAction extends Action {
|
||||
super(ChartDataAction.ID, ChartDataAction.LABEL, ChartDataAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
// show the visualizer extension recommendation notification
|
||||
this.extensionTipsService.promptRecommendedExtensionsByScenario(Constants.visualizerExtensions);
|
||||
const maxRowCount = getChartMaxRowCount(this.configurationService);
|
||||
@@ -206,7 +206,7 @@ export class VisualizerDataAction extends Action {
|
||||
super(VisualizerDataAction.ID, VisualizerDataAction.LABEL, VisualizerDataAction.ICON);
|
||||
}
|
||||
|
||||
public async run(context: IGridActionContext): Promise<void> {
|
||||
public override async run(context: IGridActionContext): Promise<void> {
|
||||
this.adsTelemetryService.sendActionEvent(
|
||||
TelemetryKeys.TelemetryView.ResultsPanel,
|
||||
TelemetryKeys.TelemetryAction.Click,
|
||||
|
||||
@@ -185,7 +185,7 @@ export class ChangeFlavorAction extends Action {
|
||||
super(actionId, actionLabel);
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
public override run(): Promise<any> {
|
||||
let activeEditor = this._editorService.activeEditorPane;
|
||||
let currentUri = activeEditor?.input.resource?.toString(true);
|
||||
if (this._connectionManagementService.isConnected(currentUri)) {
|
||||
|
||||
@@ -311,7 +311,7 @@ export class GridPanel extends Disposable {
|
||||
return this._state;
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
dispose(this.tables);
|
||||
this.tables = undefined;
|
||||
super.dispose();
|
||||
@@ -692,7 +692,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
let content = value.displayValue;
|
||||
|
||||
const input = this.untitledEditorService.create({ mode: column.isXml ? 'xml' : 'json', initialValue: content });
|
||||
await input.load();
|
||||
await input.resolve();
|
||||
await this.instantiationService.invokeFunction(formatDocumentWithSelectedProvider, input.textEditorModel, FormattingMode.Explicit, Progress.None, CancellationToken.None);
|
||||
return this.editorService.openEditor(input);
|
||||
});
|
||||
@@ -852,7 +852,7 @@ export abstract class GridTableBase<T> extends Disposable implements IView {
|
||||
}
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
this.container.remove();
|
||||
if (this.table) {
|
||||
this.table.dispose();
|
||||
|
||||
@@ -153,7 +153,7 @@ export class GridTable<T> extends Disposable implements IView {
|
||||
return Math.max(this.maxSize, BOTTOM_PADDING);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
public override dispose() {
|
||||
this.element.remove();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export class FocusOnCurrentQueryKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.focus();
|
||||
@@ -99,7 +99,7 @@ export class RunQueryKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor || editor instanceof EditDataEditor) {
|
||||
editor.runQuery();
|
||||
@@ -124,7 +124,7 @@ export class RunCurrentQueryKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.runCurrentQuery();
|
||||
@@ -185,7 +185,7 @@ export class CopyQueryWithResultsKeyboardAction extends Action {
|
||||
return { text: allResults, html: allHtmlResults };
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
public override async run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
let allResults = await this.getFormattedResults(editor);
|
||||
@@ -219,7 +219,7 @@ export class RunCurrentQueryWithActualPlanKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.runCurrentQueryWithActualPlan();
|
||||
@@ -245,7 +245,7 @@ export class CancelQueryKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor || editor instanceof EditDataEditor) {
|
||||
editor.cancelQuery();
|
||||
@@ -271,7 +271,7 @@ export class RefreshIntellisenseKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this.editorService.activeEditor;
|
||||
if (editor instanceof QueryEditorInput) {
|
||||
this.connectionManagementService.rebuildIntelliSenseCache(editor.uri);
|
||||
@@ -297,7 +297,7 @@ export class ToggleQueryResultsKeyboardAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.toggleResultsEditorVisibility();
|
||||
@@ -324,7 +324,7 @@ export class ToggleFocusBetweenQueryEditorAndResultsAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public async run(): Promise<void> {
|
||||
public override async run(): Promise<void> {
|
||||
const editor = this._editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
editor.toggleFocusBetweenQueryEditorAndResults();
|
||||
@@ -348,7 +348,7 @@ export class RunQueryShortcutAction extends Action {
|
||||
super(RunQueryShortcutAction.ID);
|
||||
}
|
||||
|
||||
public run(index: number): Promise<void> {
|
||||
public override run(index: number): Promise<void> {
|
||||
let promise: Thenable<void> = Promise.resolve(null);
|
||||
runActionOnActiveQueryEditor(this.editorService, (editor) => {
|
||||
promise = this.runQueryShortcut(editor, index);
|
||||
@@ -508,7 +508,7 @@ export class ParseSyntaxAction extends Action {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public run(): Promise<void> {
|
||||
public override run(): Promise<void> {
|
||||
const editor = this.editorService.activeEditorPane;
|
||||
if (editor instanceof QueryEditor) {
|
||||
if (!editor.isSelectionEmpty()) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user