mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Merge from vscode 7eaf220cafb9d9e901370ffce02229171cbf3ea6
This commit is contained in:
committed by
Anthony Dresser
parent
39d9eed585
commit
a63578e6f7
@@ -203,7 +203,7 @@ export class CodeComponent extends CellView implements OnInit, OnChanges {
|
||||
cellModelSource = Array.isArray(this.cellModel.source) ? this.cellModel.source.join('') : this.cellModel.source;
|
||||
const model = this._instantiationService.createInstance(UntitledTextEditorModel, uri, false, cellModelSource, this.cellModel.language, undefined);
|
||||
this._editorInput = this._instantiationService.createInstance(UntitledTextEditorInput, model);
|
||||
await this._editor.setInput(this._editorInput, undefined);
|
||||
await this._editor.setInput(this._editorInput, undefined, undefined);
|
||||
this.setFocusAndScroll();
|
||||
|
||||
let untitledEditorModel = await this._editorInput.resolve() as UntitledTextEditorModel;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { EditorOptions } from 'vs/workbench/common/editor';
|
||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||
import { EditorOptions, IEditorOpenContext } from 'vs/workbench/common/editor';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/bootstrapService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -35,7 +35,7 @@ import { TimeoutTimer } from 'vs/base/common/async';
|
||||
import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
export class NotebookEditor extends BaseEditor implements IFindNotebookController {
|
||||
export class NotebookEditor extends EditorPane implements IFindNotebookController {
|
||||
|
||||
public static ID: string = 'workbench.editor.notebookEditor';
|
||||
private _notebookContainer: HTMLElement;
|
||||
@@ -187,14 +187,14 @@ export class NotebookEditor extends BaseEditor implements IFindNotebookControlle
|
||||
}
|
||||
}
|
||||
|
||||
public async setInput(input: NotebookInput, options: EditorOptions): Promise<void> {
|
||||
public async setInput(input: NotebookInput, options: EditorOptions, context: IEditorOpenContext): Promise<void> {
|
||||
if (this.input && this.input.matches(input)) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
const parentElement = this.getContainer();
|
||||
|
||||
await super.setInput(input, options, CancellationToken.None);
|
||||
await super.setInput(input, options, context, CancellationToken.None);
|
||||
DOM.clearNode(parentElement);
|
||||
await this.setFindInput(parentElement);
|
||||
if (!input.hasBootstrapped) {
|
||||
|
||||
@@ -126,7 +126,7 @@ suite.skip('Test class NotebookEditor:', () => {
|
||||
const testNotebookEditor = new NotebookEditorStub({ cellGuid: cellTextEditorGuid, editor: queryTextEditor, model: notebookModel, notebookParams: <INotebookParams>{ notebookUri: untitledNotebookInput.notebookUri } });
|
||||
notebookService.addNotebookEditor(testNotebookEditor);
|
||||
notebookEditor.clearInput();
|
||||
await notebookEditor.setInput(untitledNotebookInput, EditorOptions.create({ pinned: true }));
|
||||
await notebookEditor.setInput(untitledNotebookInput, EditorOptions.create({ pinned: true }), undefined);
|
||||
untitledNotebookInput.notebookFindModel.notebookModel = undefined; // clear preexisting notebookModel
|
||||
const result = await notebookEditor.getNotebookModel();
|
||||
assert.strictEqual(result, notebookModel, `getNotebookModel() should return the model set in the INotebookEditor object`);
|
||||
@@ -214,7 +214,7 @@ suite.skip('Test class NotebookEditor:', () => {
|
||||
untitledNotebookInput /* set to a known input */,
|
||||
untitledNotebookInput /* tries to set the same input that was previously set */
|
||||
]) {
|
||||
await notebookEditor.setInput(input, editorOptions);
|
||||
await notebookEditor.setInput(input, editorOptions, undefined);
|
||||
assert.strictEqual(notebookEditor.input, input, `notebookEditor.input should be the one that we set`);
|
||||
}
|
||||
});
|
||||
@@ -225,7 +225,7 @@ suite.skip('Test class NotebookEditor:', () => {
|
||||
for (const isRevealed of [true, false]) {
|
||||
notebookEditor['_findState']['_isRevealed'] = isRevealed;
|
||||
notebookEditor.clearInput();
|
||||
await notebookEditor.setInput(untitledNotebookInput, editorOptions);
|
||||
await notebookEditor.setInput(untitledNotebookInput, editorOptions, undefined);
|
||||
assert.strictEqual(notebookEditor.input, untitledNotebookInput, `notebookEditor.input should be the one that we set`);
|
||||
}
|
||||
});
|
||||
@@ -744,7 +744,7 @@ async function setupNotebookEditor(notebookEditor: NotebookEditor, untitledNoteb
|
||||
|
||||
async function setInputDocument(notebookEditor: NotebookEditor, untitledNotebookInput: UntitledNotebookInput): Promise<void> {
|
||||
const editorOptions = EditorOptions.create({ pinned: true });
|
||||
await notebookEditor.setInput(untitledNotebookInput, editorOptions);
|
||||
await notebookEditor.setInput(untitledNotebookInput, editorOptions, undefined);
|
||||
assert.strictEqual(notebookEditor.options, editorOptions, 'NotebookEditor options must be the ones that we set');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user