mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
VS Code merge to df8fe74bd55313de0dd2303bc47a4aab0ca56b0e (#17979)
* Merge from vscode 504f934659740e9d41501cad9f162b54d7745ad9 * delete unused folders * distro * Bump build node version * update chokidar * FIx hygiene errors * distro * Fix extension lint issues * Remove strict-vscode * Add copyright header exemptions * Bump vscode-extension-telemetry to fix webpacking issue with zone.js * distro * Fix failing tests (revert marked.js back to current one until we decide to update) * Skip searchmodel test * Fix mac build * temp debug script loading * Try disabling coverage * log error too * Revert "log error too" This reverts commit af0183e5d4ab458fdf44b88fbfab9908d090526f. * Revert "temp debug script loading" This reverts commit 3d687d541c76db2c5b55626c78ae448d3c25089c. * Add comments explaining coverage disabling * Fix ansi_up loading issue * Merge latest from ads * Use newer option * Fix compile * add debug logging warn * Always log stack * log more * undo debug * Update to use correct base path (+cleanup) * distro * fix compile errors * Remove strict-vscode * Fix sql editors not showing * Show db dropdown input & fix styling * Fix more info in gallery * Fix gallery asset requests * Delete unused workflow * Fix tapable resolutions for smoke test compile error * Fix smoke compile * Disable crash reporting * Disable interactive Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -106,6 +106,7 @@ export class CellToolbarComponent {
|
||||
);
|
||||
}
|
||||
taskbarContent.push(
|
||||
{ action: splitCellButton },
|
||||
{ element: addCellDropdownContainer },
|
||||
{ action: moveCellDownButton },
|
||||
{ action: moveCellUpButton },
|
||||
|
||||
@@ -10,10 +10,9 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { NotebookFindMatch, NotebookFindDecorations } from 'sql/workbench/contrib/notebook/browser/find/notebookFindDecorations';
|
||||
import * as model from 'vs/editor/common/model';
|
||||
import { ModelDecorationOptions, DidChangeDecorationsEmitter, createTextBuffer } from 'vs/editor/common/model/textModel';
|
||||
import { ModelDecorationOptions, DidChangeDecorationsEmitter, createTextBuffer, TextModel } from 'vs/editor/common/model/textModel';
|
||||
import { IModelDecorationsChangedEvent } from 'vs/editor/common/model/textModelEvents';
|
||||
import { IntervalNode } from 'vs/editor/common/model/intervalTree';
|
||||
import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions';
|
||||
import { Range, IRange } from 'vs/editor/common/core/range';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { singleLetterHash, isHighSurrogate } from 'vs/base/common/strings';
|
||||
@@ -55,7 +54,7 @@ export class NotebookFindModel extends Disposable implements INotebookFindModel
|
||||
public findExpression: string;
|
||||
|
||||
//#region Decorations
|
||||
private readonly _onDidChangeDecorations: DidChangeDecorationsEmitter = this._register(new DidChangeDecorationsEmitter());
|
||||
private readonly _onDidChangeDecorations: DidChangeDecorationsEmitter = this._register(new DidChangeDecorationsEmitter(affectedInjectedTextLines => { } /* this.handleBeforeFireDecorationsChangedEvent(affectedInjectedTextLines) */)); // Do we need this event?
|
||||
public readonly onDidChangeDecorations: Event<IModelDecorationsChangedEvent> = this._onDidChangeDecorations.event;
|
||||
private _decorations: { [decorationId: string]: NotebookIntervalNode; };
|
||||
//#endregion
|
||||
@@ -72,7 +71,7 @@ export class NotebookFindModel extends Disposable implements INotebookFindModel
|
||||
|
||||
this._decorations = Object.create(null);
|
||||
|
||||
const { textBuffer, } = createTextBuffer('', NotebookFindModel.DEFAULT_CREATION_OPTIONS.defaultEOL);
|
||||
const { textBuffer, } = createTextBuffer('', TextModel.DEFAULT_CREATION_OPTIONS.defaultEOL);
|
||||
this._buffer = textBuffer;
|
||||
this._versionId = 1;
|
||||
this.id = '$model' + MODEL_ID;
|
||||
@@ -100,17 +99,6 @@ export class NotebookFindModel extends Disposable implements INotebookFindModel
|
||||
this.clearFind();
|
||||
}
|
||||
|
||||
public static DEFAULT_CREATION_OPTIONS: model.ITextModelCreationOptions = {
|
||||
isForSimpleWidget: false,
|
||||
tabSize: EDITOR_MODEL_DEFAULTS.tabSize,
|
||||
indentSize: EDITOR_MODEL_DEFAULTS.indentSize,
|
||||
insertSpaces: EDITOR_MODEL_DEFAULTS.insertSpaces,
|
||||
detectIndentation: false,
|
||||
defaultEOL: model.DefaultEndOfLine.LF,
|
||||
trimAutoWhitespace: EDITOR_MODEL_DEFAULTS.trimAutoWhitespace,
|
||||
largeFileOptimizations: EDITOR_MODEL_DEFAULTS.largeFileOptimizations,
|
||||
};
|
||||
|
||||
public get onFindCountChange(): Event<number> { return this._onFindCountChange.event; }
|
||||
|
||||
public get VersionId(): number {
|
||||
@@ -289,7 +277,7 @@ export class NotebookFindModel extends Disposable implements INotebookFindModel
|
||||
*/
|
||||
private _validateRangeRelaxedNoAllocations(range: IRange): NotebookRange {
|
||||
if (range instanceof NotebookRange) {
|
||||
const { textBuffer, } = createTextBuffer(range.cell.source instanceof Array ? range.cell.source.join('\n') : range.cell.source, NotebookFindModel.DEFAULT_CREATION_OPTIONS.defaultEOL);
|
||||
const { textBuffer, } = createTextBuffer(range.cell.source instanceof Array ? range.cell.source.join('\n') : range.cell.source, TextModel.DEFAULT_CREATION_OPTIONS.defaultEOL);
|
||||
this._buffer = textBuffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
@INotebookService notebookService: INotebookService,
|
||||
@ILogService logService: ILogService
|
||||
) {
|
||||
let originalInput = instantiationService.createInstance(FileNotebookInput, diffInput.primary.getName(), diffInput.primary.resource, diffInput.originalInput as FileEditorInput, false);
|
||||
let modifiedInput = instantiationService.createInstance(FileNotebookInput, diffInput.secondary.getName(), diffInput.secondary.resource, diffInput.modifiedInput as FileEditorInput, false);
|
||||
let originalInput = instantiationService.createInstance(FileNotebookInput, diffInput.primary.getName(), diffInput.primary.resource, diffInput.original as FileEditorInput, false);
|
||||
let modifiedInput = instantiationService.createInstance(FileNotebookInput, diffInput.secondary.getName(), diffInput.secondary.resource, diffInput.modified as FileEditorInput, false);
|
||||
super(title, diffInput.getTitle(), modifiedInput, originalInput);
|
||||
this._notebookService = notebookService;
|
||||
this._logService = logService;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IEditorInputFactoryRegistry, IEditorInput, IEditorInputSerializer, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IEditorFactoryRegistry, IEditorInput, IEditorSerializer, 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,9 +18,9 @@ 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>(EditorExtensions.EditorInputFactories);
|
||||
const editorFactoryRegistry = Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory);
|
||||
|
||||
export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
export class NotebookEditorLanguageAssociation implements ILanguageAssociation {
|
||||
/**
|
||||
* The language IDs that are associated with Notebooks. These are case sensitive for comparing with what's
|
||||
* registered in the ModeService registry.
|
||||
@@ -53,9 +53,9 @@ export class NotebookEditorInputAssociation implements ILanguageAssociation {
|
||||
}
|
||||
}
|
||||
|
||||
export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer {
|
||||
export class FileNoteBookEditorSerializer implements IEditorSerializer {
|
||||
serialize(editorInput: FileNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorFactoryRegistry.getEditorSerializer(FILE_EDITOR_INPUT_ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): FileNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(FILE_EDITOR_INPUT_ID);
|
||||
const factory = editorFactoryRegistry.getEditorSerializer(FILE_EDITOR_INPUT_ID);
|
||||
const fileEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as FileEditorInput;
|
||||
return instantiationService.createInstance(FileNotebookInput, fileEditorInput.getName(), fileEditorInput.resource, fileEditorInput, true);
|
||||
}
|
||||
@@ -73,9 +73,9 @@ export class FileNoteBookEditorInputSerializer implements IEditorInputSerializer
|
||||
}
|
||||
}
|
||||
|
||||
export class UntitledNotebookEditorInputSerializer implements IEditorInputSerializer {
|
||||
export class UntitledNotebookEditorSerializer implements IEditorSerializer {
|
||||
serialize(editorInput: UntitledNotebookInput): string {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
const factory = editorFactoryRegistry.getEditorSerializer(UntitledTextEditorInput.ID);
|
||||
if (factory) {
|
||||
return factory.serialize(editorInput.textInput); // serialize based on the underlying input
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export class UntitledNotebookEditorInputSerializer implements IEditorInputSerial
|
||||
}
|
||||
|
||||
deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): UntitledNotebookInput | undefined {
|
||||
const factory = editorInputFactoryRegistry.getEditorInputSerializer(UntitledTextEditorInput.ID);
|
||||
const factory = editorFactoryRegistry.getEditorSerializer(UntitledTextEditorInput.ID);
|
||||
const untitledEditorInput = factory.deserialize(instantiationService, serializedEditorInput) as UntitledTextEditorInput;
|
||||
return instantiationService.createInstance(UntitledNotebookInput, untitledEditorInput.getName(), untitledEditorInput.resource, untitledEditorInput);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IRevertOptions, GroupIdentifier, IEditorInput, EditorInputCapabilities } from 'vs/workbench/common/editor';
|
||||
import { IRevertOptions, GroupIdentifier, IEditorInput, EditorInputCapabilities, IUntypedEditorInput } from 'vs/workbench/common/editor';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
@@ -513,7 +513,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._model.updateModel();
|
||||
}
|
||||
|
||||
public override matches(otherInput: any): boolean {
|
||||
public override matches(otherInput: IEditorInput | IUntypedEditorInput): boolean {
|
||||
if (otherInput instanceof NotebookInput) {
|
||||
return this.textInput.matches(otherInput.textInput);
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,6 @@ import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { MenuId, IMenuService, MenuItemAction } from 'vs/platform/actions/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';
|
||||
|
||||
import { AngularDisposable } from 'sql/base/browser/lifecycle';
|
||||
@@ -104,7 +103,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
@Inject(IConnectionDialogService) private connectionDialogService: IConnectionDialogService,
|
||||
@Inject(IContextKeyService) private contextKeyService: IContextKeyService,
|
||||
@Inject(IMenuService) private menuService: IMenuService,
|
||||
@Inject(IKeybindingService) private keybindingService: IKeybindingService,
|
||||
@Inject(ICapabilitiesService) private capabilitiesService: ICapabilitiesService,
|
||||
@Inject(ITextFileService) private textFileService: ITextFileService,
|
||||
@Inject(ILogService) private readonly logService: ILogService,
|
||||
@@ -624,7 +622,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
action.tooltip = action.label;
|
||||
action.label = '';
|
||||
}
|
||||
return new MaskedLabeledMenuItemActionItem(action, this.keybindingService, this.notificationService);
|
||||
return this.instantiationService.createInstance(MaskedLabeledMenuItemActionItem, action);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* 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 } from 'vs/workbench/browser/editor';
|
||||
import { EditorPaneDescriptor, IEditorPaneRegistry } 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, ActiveEditorContext, IEditorInput, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IEditorFactoryRegistry, 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 { FileNoteBookEditorInputSerializer, NotebookEditorInputAssociation, UntitledNotebookEditorInputSerializer } from 'sql/workbench/contrib/notebook/browser/models/notebookInputFactory';
|
||||
import { FileNoteBookEditorSerializer, NotebookEditorLanguageAssociation, UntitledNotebookEditorSerializer } from 'sql/workbench/contrib/notebook/browser/models/notebookEditorFactory';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionsExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor, registerAction2, MenuRegistry, MenuId, Action2 } from 'vs/platform/actions/common/actions';
|
||||
|
||||
@@ -56,7 +56,7 @@ import { INotebookModel } from 'sql/workbench/services/notebook/browser/models/m
|
||||
import { DEFAULT_NOTEBOOK_FILETYPE, IExecuteManager, SQL_NOTEBOOK_PROVIDER } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { NotebookExplorerViewletViewsContribution } from 'sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet';
|
||||
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ContributedEditorPriority, IEditorOverrideService } from 'vs/workbench/services/editor/common/editorOverrideService';
|
||||
import { IEditorResolverService, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService';
|
||||
import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
@@ -65,17 +65,17 @@ import { useNewMarkdownRendererKey } from 'sql/workbench/contrib/notebook/common
|
||||
import { JUPYTER_PROVIDER_ID, NotebookLanguage } from 'sql/workbench/common/constants';
|
||||
import { INotebookProviderRegistry, NotebookProviderRegistryId } from 'sql/workbench/services/notebook/common/notebookRegistry';
|
||||
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories)
|
||||
.registerEditorInputSerializer(FileNotebookInput.ID, FileNoteBookEditorInputSerializer);
|
||||
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory)
|
||||
.registerEditorSerializer(FileNotebookInput.ID, FileNoteBookEditorSerializer);
|
||||
|
||||
Registry.as<IEditorInputFactoryRegistry>(EditorExtensions.EditorInputFactories)
|
||||
.registerEditorInputSerializer(UntitledNotebookInput.ID, UntitledNotebookEditorInputSerializer);
|
||||
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory)
|
||||
.registerEditorSerializer(UntitledNotebookInput.ID, UntitledNotebookEditorSerializer);
|
||||
|
||||
Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations)
|
||||
.registerLanguageAssociation(NotebookEditorInputAssociation.languages, NotebookEditorInputAssociation);
|
||||
.registerLanguageAssociation(NotebookEditorLanguageAssociation.languages, NotebookEditorLanguageAssociation);
|
||||
|
||||
Registry.as<IEditorRegistry>(EditorExtensions.Editors)
|
||||
.registerEditor(EditorDescriptor.create(NotebookEditor, NotebookEditor.ID, NotebookEditor.LABEL), [new SyncDescriptor(UntitledNotebookInput), new SyncDescriptor(FileNotebookInput)]);
|
||||
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane)
|
||||
.registerEditorPane(EditorPaneDescriptor.create(NotebookEditor, NotebookEditor.ID, NotebookEditor.LABEL), [new SyncDescriptor(UntitledNotebookInput), new SyncDescriptor(FileNotebookInput)]);
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(NotebookThemingContribution, LifecyclePhase.Restored);
|
||||
@@ -701,7 +701,7 @@ export class NotebookEditorOverrideContribution extends Disposable implements IW
|
||||
constructor(
|
||||
@ILogService private _logService: ILogService,
|
||||
@IEditorService private _editorService: IEditorService,
|
||||
@IEditorOverrideService private _editorOverrideService: IEditorOverrideService,
|
||||
@IEditorResolverService private _editorResolverService: IEditorResolverService,
|
||||
@IModeService private _modeService: IModeService
|
||||
) {
|
||||
super();
|
||||
@@ -726,7 +726,7 @@ export class NotebookEditorOverrideContribution extends Disposable implements IW
|
||||
let allExtensions: string[] = [];
|
||||
|
||||
// List of built-in language IDs to associate the query editor for. These are case sensitive.
|
||||
NotebookEditorInputAssociation.languages.forEach(lang => {
|
||||
NotebookEditorLanguageAssociation.languages.forEach(lang => {
|
||||
const langExtensions = this._modeService.getExtensions(lang);
|
||||
allExtensions = allExtensions.concat(langExtensions);
|
||||
});
|
||||
@@ -737,37 +737,37 @@ export class NotebookEditorOverrideContribution extends Disposable implements IW
|
||||
// Create the selector from the list of all the language extensions we want to associate with the
|
||||
// notebook editor
|
||||
const selector = `*{${allExtensions.join(',')}}`;
|
||||
this._registeredOverrides.add(this._editorOverrideService.registerEditor(
|
||||
this._registeredOverrides.add(this._editorResolverService.registerEditor(
|
||||
selector,
|
||||
{
|
||||
id: NotebookEditor.ID,
|
||||
label: NotebookEditor.LABEL,
|
||||
describes: (currentEditor) => currentEditor instanceof FileNotebookInput,
|
||||
priority: ContributedEditorPriority.builtin
|
||||
priority: RegisteredEditorPriority.builtin
|
||||
},
|
||||
{},
|
||||
(resource, options, group) => {
|
||||
const fileInput = this._editorService.createEditorInput({
|
||||
resource: resource
|
||||
}) as FileEditorInput;
|
||||
(editorInput, group) => {
|
||||
const fileInput = this._editorService.createEditorInput(editorInput) as FileEditorInput;
|
||||
// Try to convert the input, falling back to just a plain file input if we're unable to
|
||||
const newInput = this.tryConvertInput(fileInput) ?? fileInput;
|
||||
return { editor: newInput, options: options, group: group };
|
||||
const newInput = this.convertInput(fileInput);
|
||||
return { editor: newInput, options: editorInput.options, group: group };
|
||||
},
|
||||
(diffEditorInput, options, group) => {
|
||||
undefined,
|
||||
(diffEditorInput, group) => {
|
||||
const diffEditorInputImpl = this._editorService.createEditorInput(diffEditorInput) as DiffEditorInput;
|
||||
// Try to convert the input, falling back to the original input if we're unable to
|
||||
const newInput = this.tryConvertInput(diffEditorInput) ?? diffEditorInput;
|
||||
return { editor: newInput, options: options, group: group };
|
||||
const newInput = this.convertInput(diffEditorInputImpl);
|
||||
return { editor: newInput, options: diffEditorInput.options, group: group };
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
private tryConvertInput(input: IEditorInput): IEditorInput | undefined {
|
||||
private convertInput(input: IEditorInput): IEditorInput {
|
||||
const langAssociation = languageAssociationRegistry.getAssociationForLanguage(NotebookLanguage.Ipynb);
|
||||
const notebookEditorInput = langAssociation?.syncConvertInput?.(input);
|
||||
if (!notebookEditorInput) {
|
||||
this._logService.warn('Unable to create input for overriding editor ', input instanceof DiffEditorInput ? `${input.primary.resource.toString()} <-> ${input.secondary.resource.toString()}` : input.resource.toString());
|
||||
return undefined;
|
||||
// Fall back to original input if we failed to convert
|
||||
this._logService.warn('Unable to create input for resolving editor ', input instanceof DiffEditorInput ? `${input.primary.resource.toString()} <-> ${input.secondary.resource.toString()}` : input.resource.toString());
|
||||
return input;
|
||||
}
|
||||
return notebookEditorInput;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootst
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
|
||||
import { MenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
@@ -71,7 +70,6 @@ export class NotebookViewComponent extends AngularDisposable implements INoteboo
|
||||
@Inject(IBootstrapParams) private _notebookParams: INotebookParams,
|
||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||
@Inject(IInstantiationService) private _instantiationService: IInstantiationService,
|
||||
@Inject(IKeybindingService) private _keybindingService: IKeybindingService,
|
||||
@Inject(IContextMenuService) private _contextMenuService: IContextMenuService,
|
||||
@Inject(INotificationService) private _notificationService: INotificationService,
|
||||
@Inject(INotebookService) private _notebookService: INotebookService,
|
||||
@@ -315,7 +313,7 @@ export class NotebookViewComponent extends AngularDisposable implements INoteboo
|
||||
action.tooltip = action.label;
|
||||
action.label = '';
|
||||
}
|
||||
return new LabeledMenuItemActionItem(action, this._keybindingService, this._notificationService, 'notebook-button fixed-width');
|
||||
return this._instantiationService.createInstance(LabeledMenuItemActionItem, action, 'notebook-button fixed-width');
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ suite('MarkdownTextTransformer', () => {
|
||||
assert(!isUndefinedOrNull(widget), 'widget is undefined');
|
||||
|
||||
// Create new text model
|
||||
textModel = new TextModel('', { isForSimpleWidget: true, defaultEOL: DefaultEndOfLine.LF, detectIndentation: true, indentSize: 0, insertSpaces: false, largeFileOptimizations: false, tabSize: 4, trimAutoWhitespace: false }, null, undefined, undoRedoService);
|
||||
textModel = new TextModel('', { isForSimpleWidget: true, defaultEOL: DefaultEndOfLine.LF, detectIndentation: true, indentSize: 0, insertSpaces: false, largeFileOptimizations: false, tabSize: 4, trimAutoWhitespace: false, bracketPairColorizationOptions: { enabled: true } }, null, undefined, undoRedoService);
|
||||
|
||||
// Couple widget with newly created text model
|
||||
widget.setModel(textModel);
|
||||
|
||||
@@ -33,7 +33,7 @@ import { FindReplaceStateChangedEvent, INewFindReplaceState } from 'vs/editor/co
|
||||
import { getRandomString } from 'vs/editor/test/common/model/linesTextBuffer/textBufferAutoTestUtils';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService';
|
||||
import { DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionManagementService, InstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { DidUninstallExtensionEvent, IExtensionManagementService, InstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
@@ -672,7 +672,6 @@ async function findStateChangeSetup(instantiationService: TestInstantiationServi
|
||||
|
||||
function setupServices(arg: { workbenchThemeService?: WorkbenchThemeService, instantiationService?: TestInstantiationService } = {}) {
|
||||
const installEvent: Emitter<InstallExtensionEvent> = new Emitter<InstallExtensionEvent>();
|
||||
const didInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
const uninstallEvent = new Emitter<IExtensionIdentifier>();
|
||||
const didUninstallEvent = new Emitter<DidUninstallExtensionEvent>();
|
||||
|
||||
@@ -684,7 +683,6 @@ function setupServices(arg: { workbenchThemeService?: WorkbenchThemeService, ins
|
||||
|
||||
instantiationService.stub(IExtensionManagementService, ExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementService, 'onInstallExtension', installEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidInstallExtension', didInstallEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onUninstallExtension', uninstallEvent.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidUninstallExtension', didUninstallEvent.event);
|
||||
|
||||
|
||||
@@ -173,8 +173,6 @@ suite('Notebook Input', function (): void {
|
||||
});
|
||||
|
||||
test('Matches other input', async function (): Promise<void> {
|
||||
assert.strictEqual(untitledNotebookInput.matches(undefined), false, 'Input should not match undefined.');
|
||||
|
||||
assert.ok(untitledNotebookInput.matches(untitledNotebookInput), 'Input should match itself.');
|
||||
|
||||
let otherTestUri = URI.from({ scheme: Schemas.untitled, path: 'OtherTestPath' });
|
||||
|
||||
@@ -20,7 +20,7 @@ import * as TypeMoq from 'typemoq';
|
||||
import { errorHandler, onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionIdentifier, IExtensionManagementService, InstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { DidUninstallExtensionEvent, IExtensionIdentifier, IExtensionManagementService, InstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
@@ -154,7 +154,6 @@ suite.skip('NotebookService:', function (): void {
|
||||
let editorGroupsService: IEditorGroupsService;
|
||||
|
||||
let installExtensionEmitter: Emitter<InstallExtensionEvent>,
|
||||
didInstallExtensionEmitter: Emitter<DidInstallExtensionEvent>,
|
||||
uninstallExtensionEmitter: Emitter<IExtensionIdentifier>,
|
||||
didUninstallExtensionEmitter: Emitter<DidUninstallExtensionEvent>;
|
||||
let configurationService: IConfigurationService;
|
||||
@@ -178,14 +177,12 @@ suite.skip('NotebookService:', function (): void {
|
||||
instantiationService = new TestInstantiationService();
|
||||
|
||||
installExtensionEmitter = new Emitter<InstallExtensionEvent>();
|
||||
didInstallExtensionEmitter = new Emitter<DidInstallExtensionEvent>();
|
||||
uninstallExtensionEmitter = new Emitter<IExtensionIdentifier>();
|
||||
didUninstallExtensionEmitter = new Emitter<DidUninstallExtensionEvent>();
|
||||
configurationService = new TestConfigurationService();
|
||||
|
||||
instantiationService.stub(IExtensionManagementService, ExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementService, 'onInstallExtension', installExtensionEmitter.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidInstallExtension', didInstallExtensionEmitter.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onUninstallExtension', uninstallExtensionEmitter.event);
|
||||
instantiationService.stub(IExtensionManagementService, 'onDidUninstallExtension', didUninstallExtensionEmitter.event);
|
||||
extensionManagementService = instantiationService.get(IExtensionManagementService);
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
import { TestFileDialogService, TestLayoutService, TestPathService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as assert from 'assert';
|
||||
|
||||
import { ILinkCalloutDialogOptions, LinkCalloutDialog } from 'sql/workbench/contrib/notebook/browser/calloutDialog/linkCalloutDialog';
|
||||
|
||||
@@ -555,22 +555,22 @@ export class NodeStub implements Node {
|
||||
get baseURI(): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get childNodes(): NodeListOf<ChildNode> {
|
||||
get childNodes(): NodeListOf<ChildNode & Node> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get firstChild(): ChildNode {
|
||||
get firstChild(): ChildNode & Node {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get isConnected(): boolean {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get lastChild(): ChildNode {
|
||||
get lastChild(): ChildNode & Node {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get namespaceURI(): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get nextSibling(): ChildNode {
|
||||
get nextSibling(): ChildNode & Node {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get nodeName(): string {
|
||||
@@ -588,7 +588,7 @@ export class NodeStub implements Node {
|
||||
get parentNode(): Node & ParentNode {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
get previousSibling(): ChildNode {
|
||||
get previousSibling(): ChildNode & Node {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
nodeValue: string;
|
||||
|
||||
Reference in New Issue
Block a user