mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user