Merge branch 'notebook/dev' into main
This commit is contained in:
commit
d5ecfd54f1
5 changed files with 12 additions and 37 deletions
2
.vscode/notebooks/endgame.github-issues
vendored
2
.vscode/notebooks/endgame.github-issues
vendored
|
@ -8,7 +8,7 @@
|
|||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-emmet-helper\n\n$MILESTONE=milestone:\"March 2021\"",
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-emmet-helper\n\n$MILESTONE=milestone:\"April 2021\"",
|
||||
"editable": true
|
||||
},
|
||||
{
|
||||
|
|
7
src/vs/vscode.proposed.d.ts
vendored
7
src/vs/vscode.proposed.d.ts
vendored
|
@ -1196,13 +1196,6 @@ declare module 'vscode' {
|
|||
* The column in which this editor shows.
|
||||
*/
|
||||
readonly viewColumn?: ViewColumn;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
// @rebornix REMOVE/REplace NotebookCommunication
|
||||
// todo@API fishy? notebooks are public objects, there should be a "global" events for this
|
||||
readonly onDidDispose: Event<void>;
|
||||
}
|
||||
|
||||
export interface NotebookDocumentMetadataChangeEvent {
|
||||
|
|
|
@ -669,6 +669,11 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
}
|
||||
|
||||
private _createExtHostEditor(document: ExtHostNotebookDocument, editorId: string, data: INotebookEditorAddData) {
|
||||
|
||||
if (this._editors.has(editorId)) {
|
||||
throw new Error(`editor with id ALREADY EXSIST: ${editorId}`);
|
||||
}
|
||||
|
||||
const revivedUri = document.uri;
|
||||
let webComm = this._webviewComm.get(editorId);
|
||||
|
||||
|
@ -686,13 +691,10 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
typeof data.viewColumn === 'number' ? typeConverters.ViewColumn.to(data.viewColumn) : undefined
|
||||
);
|
||||
|
||||
|
||||
this._editors.get(editorId)?.editor.dispose();
|
||||
this._editors.set(editorId, { editor });
|
||||
}
|
||||
|
||||
$acceptDocumentAndEditorsDelta(delta: INotebookDocumentsAndEditorsDelta): void {
|
||||
let editorChanged = false;
|
||||
|
||||
if (delta.removedDocuments) {
|
||||
for (const uri of delta.removedDocuments) {
|
||||
|
@ -708,9 +710,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
|
||||
for (const e of this._editors.values()) {
|
||||
if (e.editor.notebookData.uri.toString() === revivedUri.toString()) {
|
||||
e.editor.dispose();
|
||||
this._editors.delete(e.editor.id);
|
||||
editorChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -782,7 +782,6 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
|
||||
if (document) {
|
||||
this._createExtHostEditor(document, editorModelData.id, editorModelData);
|
||||
editorChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -794,7 +793,6 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
const editor = this._editors.get(editorid);
|
||||
|
||||
if (editor) {
|
||||
editorChanged = true;
|
||||
this._editors.delete(editorid);
|
||||
|
||||
if (this._activeNotebookEditor?.id === editor.editor.id) {
|
||||
|
@ -806,12 +804,6 @@ export class ExtHostNotebookController implements ExtHostNotebookShape {
|
|||
}
|
||||
}
|
||||
|
||||
if (editorChanged) {
|
||||
removedEditors.forEach(e => {
|
||||
e.editor.dispose();
|
||||
});
|
||||
}
|
||||
|
||||
if (delta.visibleEditors) {
|
||||
this._visibleNotebookEditors = delta.visibleEditors.map(id => this._editors.get(id)!.editor).filter(editor => !!editor) as ExtHostNotebookEditor[];
|
||||
const visibleEditorsSet = new Set<string>();
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { MainThreadNotebookEditorsShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
|
||||
import * as extHostConverter from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
|
@ -93,9 +92,6 @@ export class ExtHostNotebookEditor {
|
|||
private _kernel?: vscode.NotebookKernel;
|
||||
|
||||
private readonly _hasDecorationsForKey = new Set<string>();
|
||||
private readonly _onDidDispose = new Emitter<void>();
|
||||
readonly onDidDispose: Event<void> = this._onDidDispose.event;
|
||||
|
||||
|
||||
private _editor?: vscode.NotebookEditor;
|
||||
|
||||
|
@ -112,11 +108,6 @@ export class ExtHostNotebookEditor {
|
|||
this._viewColumn = viewColumn;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._onDidDispose.fire();
|
||||
this._onDidDispose.dispose();
|
||||
}
|
||||
|
||||
get editor(): vscode.NotebookEditor {
|
||||
if (!this._editor) {
|
||||
const that = this;
|
||||
|
@ -144,9 +135,6 @@ export class ExtHostNotebookEditor {
|
|||
get viewColumn() {
|
||||
return that._viewColumn;
|
||||
},
|
||||
get onDidDispose() {
|
||||
return that.onDidDispose;
|
||||
},
|
||||
edit(callback) {
|
||||
const edit = new NotebookEditorCellEditBuilder(this.document.version);
|
||||
callback(edit);
|
||||
|
|
|
@ -407,10 +407,9 @@ export class CellOutputContainer extends Disposable {
|
|||
}
|
||||
|
||||
this.templateData.outputShowMoreContainer.innerText = '';
|
||||
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement());
|
||||
// this.templateData.outputShowMoreContainer.style.top = `${this.viewCell.layoutInfo.outputShowMoreContainerOffset}px`;
|
||||
|
||||
if (this.viewCell.outputsViewModels.length < OUTPUT_COUNT_LIMIT) {
|
||||
if (this.viewCell.outputsViewModels.length > OUTPUT_COUNT_LIMIT) {
|
||||
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement());
|
||||
} else {
|
||||
DOM.hide(this.templateData.outputShowMoreContainer);
|
||||
this.viewCell.updateOutputShowMoreContainerHeight(0);
|
||||
}
|
||||
|
@ -536,6 +535,9 @@ export class CellOutputContainer extends Disposable {
|
|||
|
||||
if (this.viewCell.outputsViewModels.length > OUTPUT_COUNT_LIMIT) {
|
||||
DOM.show(this.templateData.outputShowMoreContainer);
|
||||
if (!this.templateData.outputShowMoreContainer.hasChildNodes()) {
|
||||
this.templateData.outputShowMoreContainer.appendChild(this._generateShowMoreElement());
|
||||
}
|
||||
this.viewCell.updateOutputShowMoreContainerHeight(46);
|
||||
} else {
|
||||
DOM.hide(this.templateData.outputShowMoreContainer);
|
||||
|
|
Loading…
Reference in a new issue