mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 17:23:45 -05:00
Merge vscode source through 1.62 release (#19981)
* Build breaks 1 * Build breaks * Build breaks * Build breaks * More build breaks * Build breaks (#2512) * Runtime breaks * Build breaks * Fix dialog location break * Update typescript * Fix ASAR break issue * Unit test breaks * Update distro * Fix breaks in ADO builds (#2513) * Bump to node 16 * Fix hygiene errors * Bump distro * Remove reference to node type * Delete vscode specific extension * Bump to node 16 in CI yaml * Skip integration tests in CI builds (while fixing) * yarn.lock update * Bump moment dependency in remote yarn * Fix drop-down chevron style * Bump to node 16 * Remove playwrite from ci.yaml * Skip building build scripts in hygine check
This commit is contained in:
@@ -40,7 +40,7 @@ import { IQuickInputService, QuickPickInput } from 'vs/platform/quickinput/commo
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ILanguagePickInput } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions';
|
||||
import { ILanguagePickInput } from 'vs/workbench/contrib/notebook/browser/controller/editActions';
|
||||
|
||||
export const CODE_SELECTOR: string = 'code-component';
|
||||
const MARKDOWN_CLASS = 'markdown';
|
||||
|
||||
@@ -14,6 +14,7 @@ import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor';
|
||||
import { nb } from 'azdata';
|
||||
import { NotebookModel } from 'sql/workbench/services/notebook/browser/models/notebookModel';
|
||||
import { NotebookInput } from 'sql/workbench/contrib/notebook/browser/models/notebookInput';
|
||||
import { ICodeEditorViewState } from 'vs/editor/common/editorCommon';
|
||||
|
||||
export const findHighlightClass = 'rangeHighlight';
|
||||
export const findRangeSpecificClass = 'rangeSpecificHighlight';
|
||||
@@ -33,7 +34,7 @@ export abstract class CellView extends AngularDisposable implements OnDestroy, I
|
||||
|
||||
public abstract layout(): void;
|
||||
|
||||
public getEditor(): BaseTextEditor | undefined {
|
||||
public getEditor(): BaseTextEditor<ICodeEditorViewState> | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,23 +44,23 @@ export class MarkdownToolbarComponent extends AngularDisposable {
|
||||
if (this.cellModel?.currentMode === CellEditModes.SPLIT || this.cellModel?.currentMode === CellEditModes.MARKDOWN) {
|
||||
const keyEvent = new StandardKeyboardEvent(e);
|
||||
let markdownTextTransformer = new MarkdownTextTransformer(this._notebookService, this.cellModel);
|
||||
if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_B) {
|
||||
if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyB) {
|
||||
// Bold Text
|
||||
DOM.EventHelper.stop(e, true);
|
||||
await markdownTextTransformer.transformText(MarkdownButtonType.BOLD);
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_I) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyI) {
|
||||
// Italicize text
|
||||
DOM.EventHelper.stop(e, true);
|
||||
await markdownTextTransformer.transformText(MarkdownButtonType.ITALIC);
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_U) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyU) {
|
||||
// Underline text
|
||||
DOM.EventHelper.stop(e, true);
|
||||
await markdownTextTransformer.transformText(MarkdownButtonType.UNDERLINE);
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KEY_K) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KeyK) {
|
||||
// Code Block
|
||||
DOM.EventHelper.stop(e, true);
|
||||
await markdownTextTransformer.transformText(MarkdownButtonType.CODE);
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KEY_H) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KeyH) {
|
||||
// Highlight Text
|
||||
DOM.EventHelper.stop(e, true);
|
||||
await markdownTextTransformer.transformText(MarkdownButtonType.HIGHLIGHT);
|
||||
|
||||
@@ -64,12 +64,12 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
if (DOM.getActiveElement() === this.output?.nativeElement && this.isActive() && this.cellModel?.currentMode === CellEditModes.WYSIWYG) {
|
||||
const keyEvent = new StandardKeyboardEvent(e);
|
||||
// Select all text
|
||||
if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_A) {
|
||||
if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyA) {
|
||||
preventDefaultAndExecCommand(e, 'selectAll');
|
||||
} else if ((keyEvent.metaKey && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KEY_Z) || (keyEvent.ctrlKey && keyEvent.keyCode === KeyCode.KEY_Y) && !this.markdownMode) {
|
||||
} else if ((keyEvent.metaKey && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KeyZ) || (keyEvent.ctrlKey && keyEvent.keyCode === KeyCode.KeyY) && !this.markdownMode) {
|
||||
// Redo text
|
||||
this.redoRichTextChange();
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_Z) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyZ) {
|
||||
// Undo text
|
||||
this.undoRichTextChange();
|
||||
} else if (keyEvent.shiftKey && keyEvent.keyCode === KeyCode.Tab) {
|
||||
@@ -78,23 +78,23 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
} else if (keyEvent.keyCode === KeyCode.Tab) {
|
||||
// Indent text
|
||||
preventDefaultAndExecCommand(e, 'indent');
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_B) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyB) {
|
||||
// Bold text
|
||||
preventDefaultAndExecCommand(e, 'bold');
|
||||
this.cellModel.notebookModel.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.WYSIWYGKeyboardAction, { transformAction: 'BOLD' });
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_I) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyI) {
|
||||
// Italicize text
|
||||
preventDefaultAndExecCommand(e, 'italic');
|
||||
this.cellModel.notebookModel.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.WYSIWYGKeyboardAction, { transformAction: 'ITALIC' });
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KEY_U) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.keyCode === KeyCode.KeyU) {
|
||||
// Underline text
|
||||
preventDefaultAndExecCommand(e, 'underline');
|
||||
this.cellModel.notebookModel.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.WYSIWYGKeyboardAction, { transformAction: 'UNDERLINE' });
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KEY_K) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KeyK) {
|
||||
// Code Block
|
||||
preventDefaultAndExecCommand(e, 'formatBlock', false, 'pre');
|
||||
this.cellModel.notebookModel.sendNotebookTelemetryActionEvent(TelemetryKeys.NbTelemetryAction.WYSIWYGKeyboardAction, { transformAction: 'CODE' });
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KEY_H) {
|
||||
} else if ((keyEvent.ctrlKey || keyEvent.metaKey) && keyEvent.shiftKey && keyEvent.keyCode === KeyCode.KeyH) {
|
||||
// Highlight Text
|
||||
DOM.EventHelper.stop(e, true);
|
||||
highlightSelectedText();
|
||||
|
||||
@@ -739,7 +739,7 @@ export const findCommand = new SearchNotebookCommand({
|
||||
id: NOTEBOOK_COMMAND_SEARCH,
|
||||
precondition: ActiveEditorContext.isEqualTo(NotebookEditor.ID),
|
||||
kbOpts: {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KeyF,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ import { FileNotebookInput } from 'sql/workbench/contrib/notebook/browser/models
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { Deferred } from 'sql/base/common/promise';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
||||
export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
public static override ID: string = 'workbench.editorinputs.DiffNotebookInput';
|
||||
@@ -22,11 +23,12 @@ export class DiffNotebookInput extends SideBySideEditorInput {
|
||||
diffInput: DiffEditorInput,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@INotebookService notebookService: INotebookService,
|
||||
@ILogService logService: ILogService
|
||||
@ILogService logService: ILogService,
|
||||
@IEditorService editorService: IEditorService
|
||||
) {
|
||||
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);
|
||||
super(title, diffInput.getTitle(), modifiedInput, originalInput, editorService);
|
||||
this._notebookService = notebookService;
|
||||
this._logService = logService;
|
||||
this.setupScrollListeners(originalInput, modifiedInput);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IEditorFactoryRegistry, IEditorInput, IEditorSerializer, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IEditorFactoryRegistry, 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';
|
||||
@@ -17,6 +17,7 @@ import { NotebookLanguage } from 'sql/workbench/common/constants';
|
||||
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';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
|
||||
const editorFactoryRegistry = Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory);
|
||||
|
||||
@@ -29,7 +30,7 @@ export class NotebookEditorLanguageAssociation implements ILanguageAssociation {
|
||||
|
||||
constructor(@IInstantiationService private readonly instantiationService: IInstantiationService, @IConfigurationService private readonly configurationService: IConfigurationService) { }
|
||||
|
||||
convertInput(activeEditor: IEditorInput): NotebookInput | DiffNotebookInput | undefined {
|
||||
convertInput(activeEditor: EditorInput): NotebookInput | DiffNotebookInput | undefined {
|
||||
if (activeEditor instanceof FileEditorInput) {
|
||||
return this.instantiationService.createInstance(FileNotebookInput, activeEditor.getName(), activeEditor.resource, activeEditor, true);
|
||||
} else if (activeEditor instanceof UntitledTextEditorInput) {
|
||||
@@ -44,11 +45,11 @@ export class NotebookEditorLanguageAssociation implements ILanguageAssociation {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
syncConvertInput(activeEditor: IEditorInput): NotebookInput | DiffNotebookInput | undefined {
|
||||
syncConvertInput(activeEditor: EditorInput): NotebookInput | DiffNotebookInput | undefined {
|
||||
return this.convertInput(activeEditor);
|
||||
}
|
||||
|
||||
createBase(activeEditor: NotebookInput): IEditorInput {
|
||||
createBase(activeEditor: NotebookInput): EditorInput {
|
||||
return activeEditor.textInput;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IRevertOptions, GroupIdentifier, IEditorInput, EditorInputCapabilities, IUntypedEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IRevertOptions, GroupIdentifier, 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';
|
||||
@@ -330,7 +330,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._standardKernels;
|
||||
}
|
||||
|
||||
override async save(groupId: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async save(groupId: number, options?: ITextFileSaveOptions): Promise<EditorInput | undefined> {
|
||||
await this.updateModel();
|
||||
let input = await this.textInput.save(groupId, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
@@ -338,7 +338,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return langAssociation.convertInput(input);
|
||||
}
|
||||
|
||||
override async saveAs(group: number, options?: ITextFileSaveOptions): Promise<IEditorInput | undefined> {
|
||||
override async saveAs(group: number, options?: ITextFileSaveOptions): Promise<EditorInput | undefined> {
|
||||
await this.updateModel();
|
||||
let input = await this.textInput.saveAs(group, options);
|
||||
await this.setTrustForNewEditor(input);
|
||||
@@ -346,7 +346,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return langAssociation.convertInput(input);
|
||||
}
|
||||
|
||||
private async setTrustForNewEditor(newInput: IEditorInput | undefined): Promise<void> {
|
||||
private async setTrustForNewEditor(newInput: EditorInput | undefined): Promise<void> {
|
||||
let model = this._model.getNotebookModel();
|
||||
if (model?.trustedMode && newInput && newInput.resource !== this.resource) {
|
||||
await this.notebookService.serializeNotebookStateChange(newInput.resource, NotebookChangeType.Saved, undefined, true);
|
||||
@@ -533,7 +533,7 @@ export abstract class NotebookInput extends EditorInput implements INotebookInpu
|
||||
return this._model.updateModel();
|
||||
}
|
||||
|
||||
public override matches(otherInput: IEditorInput | IUntypedEditorInput): boolean {
|
||||
public override matches(otherInput: EditorInput | IUntypedEditorInput): boolean {
|
||||
if (otherInput instanceof NotebookInput) {
|
||||
return this.textInput.matches(otherInput.textInput);
|
||||
} else {
|
||||
|
||||
@@ -255,7 +255,7 @@ export class NotebookTextFileModel {
|
||||
let sourceBeforeColumn = textEditorModel.textEditorModel.getLineMaxColumn(sourceBeforeLineNumber);
|
||||
if (sourceBeforeColumn) {
|
||||
// Match the end of the source array
|
||||
let sourceEnd = textEditorModel.textEditorModel.matchBracket({ column: sourceBeforeColumn - 1, lineNumber: sourceBeforeLineNumber });
|
||||
let sourceEnd = textEditorModel.textEditorModel.bracketPairs.matchBracket({ column: sourceBeforeColumn - 1, lineNumber: sourceBeforeLineNumber });
|
||||
if (sourceEnd?.length === 2) {
|
||||
// Last quote in the source array will end the line before the source array
|
||||
// e.g.
|
||||
@@ -310,7 +310,7 @@ export class NotebookTextFileModel {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
let outputsEnd = textEditorModel.textEditorModel.matchBracket({ column: outputsBegin.endColumn - 1, lineNumber: outputsBegin.endLineNumber });
|
||||
let outputsEnd = textEditorModel.textEditorModel.bracketPairs.matchBracket({ column: outputsBegin.endColumn - 1, lineNumber: outputsBegin.endLineNumber });
|
||||
if (!outputsEnd || outputsEnd.length < 2) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
|
||||
}
|
||||
|
||||
isActive(): boolean {
|
||||
return this.editorService.activeEditor ? this.editorService.activeEditor.matches(this.notebookParams.input) : false;
|
||||
return this.editorService.activeEditor ? this.editorService.activeEditor.matches(<any>this.notebookParams.input) : false;
|
||||
}
|
||||
|
||||
isVisible(): boolean {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IEditorFactoryRegistry, ActiveEditorContext, IEditorInput, EditorExtensions } from 'vs/workbench/common/editor';
|
||||
import { IEditorFactoryRegistry, ActiveEditorContext, 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';
|
||||
@@ -24,7 +24,6 @@ import { GridOutputComponent } from 'sql/workbench/contrib/notebook/browser/outp
|
||||
import { PlotlyOutputComponent } from 'sql/workbench/contrib/notebook/browser/outputs/plotlyOutput.component';
|
||||
import { registerComponentType } from 'sql/workbench/contrib/notebook/browser/outputs/mimeRegistry';
|
||||
import { MimeRendererComponent } from 'sql/workbench/contrib/notebook/browser/outputs/mimeRenderer.component';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -64,6 +63,9 @@ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
|
||||
import { useNewMarkdownRendererKey } from 'sql/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { JUPYTER_PROVIDER_ID, NotebookLanguage } from 'sql/workbench/common/constants';
|
||||
import { INotebookProviderRegistry, NotebookProviderRegistryId } from 'sql/workbench/services/notebook/common/notebookRegistry';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
import { IViewDescriptorService, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
|
||||
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory)
|
||||
.registerEditorSerializer(FileNotebookInput.ID, FileNoteBookEditorSerializer);
|
||||
@@ -88,7 +90,7 @@ actionRegistry.registerWorkbenchAction(
|
||||
NewNotebookAction,
|
||||
NewNotebookAction.ID,
|
||||
NewNotebookAction.LABEL,
|
||||
{ primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.KEY_N },
|
||||
{ primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.KeyN },
|
||||
|
||||
),
|
||||
NewNotebookAction.LABEL
|
||||
@@ -185,7 +187,7 @@ CommandsRegistry.registerCommand({
|
||||
id: RESTART_JUPYTER_NOTEBOOK_SESSIONS,
|
||||
handler: async (accessor: ServicesAccessor, restartJupyterServer: boolean = true) => {
|
||||
const editorService: IEditorService = accessor.get(IEditorService);
|
||||
const editors: readonly IEditorInput[] = editorService.editors;
|
||||
const editors: readonly EditorInput[] = editorService.editors;
|
||||
let jupyterServerRestarted: boolean = false;
|
||||
|
||||
for (let editor of editors) {
|
||||
@@ -219,7 +221,7 @@ CommandsRegistry.registerCommand({
|
||||
id: STOP_JUPYTER_NOTEBOOK_SESSIONS,
|
||||
handler: async (accessor: ServicesAccessor) => {
|
||||
const editorService: IEditorService = accessor.get(IEditorService);
|
||||
const editors: readonly IEditorInput[] = editorService.editors;
|
||||
const editors: readonly EditorInput[] = editorService.editors;
|
||||
|
||||
for (let editor of editors) {
|
||||
if (editor instanceof NotebookInput) {
|
||||
@@ -274,7 +276,8 @@ registerAction2(class extends Action2 {
|
||||
}
|
||||
|
||||
run = async (accessor, options: { forceNewWindow: boolean, folderPath: URI }) => {
|
||||
const viewletService = accessor.get(IViewletService);
|
||||
const viewletService: IPaneCompositePartService = accessor.get(IPaneCompositePartService);
|
||||
const viewDescriptorService: IViewDescriptorService = accessor.get(IViewDescriptorService);
|
||||
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
|
||||
const hostService = accessor.get(IHostService);
|
||||
let folders = [];
|
||||
@@ -283,7 +286,8 @@ registerAction2(class extends Action2 {
|
||||
}
|
||||
folders.push(options.folderPath);
|
||||
await workspaceEditingService.addFolders(folders.map(folder => ({ uri: folder })));
|
||||
await viewletService.openViewlet(viewletService.getDefaultViewletId(), true);
|
||||
await viewletService.openPaneComposite(viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id,
|
||||
ViewContainerLocation.Sidebar, true);
|
||||
if (options.forceNewWindow) {
|
||||
return hostService.openWindow([{ folderUri: folders[0] }], { forceNewWindow: options.forceNewWindow });
|
||||
}
|
||||
@@ -794,7 +798,7 @@ export class NotebookEditorOverrideContribution extends Disposable implements IW
|
||||
));
|
||||
}
|
||||
|
||||
private convertInput(input: IEditorInput): IEditorInput {
|
||||
private convertInput(input: EditorInput): EditorInput {
|
||||
const langAssociation = languageAssociationRegistry.getAssociationForLanguage(NotebookLanguage.Ipynb);
|
||||
const notebookEditorInput = langAssociation?.syncConvertInput?.(input);
|
||||
if (!notebookEditorInput) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { ACTION_IDS, NOTEBOOK_MAX_MATCHES, IFindNotebookController, FindWidget, IConfigurationChangedEvent } from 'sql/workbench/contrib/notebook/browser/find/notebookFindWidget';
|
||||
import { IOverlayWidget } from 'vs/editor/browser/editorBrowser';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { ICodeEditorViewState, IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { NotebookFindNextAction, NotebookFindPreviousAction } from 'sql/workbench/contrib/notebook/browser/notebookActions';
|
||||
@@ -94,7 +94,7 @@ export class NotebookEditor extends EditorPane implements IFindNotebookControlle
|
||||
public getLastPosition(): NotebookRange {
|
||||
return this._previousMatch;
|
||||
}
|
||||
public getCellEditor(cellGuid: string): BaseTextEditor | undefined {
|
||||
public getCellEditor(cellGuid: string): BaseTextEditor<ICodeEditorViewState> | undefined {
|
||||
let editorImpl = this._notebookService.findNotebookEditor(this.notebookInput.notebookUri);
|
||||
if (editorImpl) {
|
||||
let cellEditorProvider = editorImpl.cellEditors.filter(c => c.cellGuid() === cellGuid)[0];
|
||||
|
||||
@@ -416,7 +416,7 @@ export const NOTEBOOK_VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(View
|
||||
ctorDescriptor: new SyncDescriptor(NotebookExplorerViewPaneContainer),
|
||||
openCommandActionDescriptor: {
|
||||
id: VIEWLET_ID,
|
||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_B },
|
||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyB },
|
||||
order: 0
|
||||
},
|
||||
icon: { id: notebookIconId },
|
||||
|
||||
@@ -384,7 +384,7 @@ export class NotebookSearchView extends SearchView {
|
||||
}
|
||||
|
||||
protected override async refreshAndUpdateCount(event?: IChangeEvent): Promise<void> {
|
||||
this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles, false);
|
||||
this.updateSearchResultCount(this.viewModel.searchResult.query!.userDisabledExcludesAndIgnoreFiles);
|
||||
return this.refreshTree(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user