Skip to content

Commit

Permalink
handle raw cell multile line source
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Apr 2, 2020
1 parent bd6ad55 commit 9f48b00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ declare module 'vscode' {
}

export interface NotebookEditorCellEdit {
insert(index: number, content: string, language: string, type: CellKind, outputs: CellOutput[], metadata: NotebookCellMetadata | undefined): void;
insert(index: number, content: string | string[], language: string, type: CellKind, outputs: CellOutput[], metadata: NotebookCellMetadata | undefined): void;
delete(index: number): void;
}

Expand Down
5 changes: 3 additions & 2 deletions src/vs/workbench/api/common/extHostNotebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,12 @@ export class NotebookEditorCellEdit {
}
}

insert(index: number, content: string, language: string, type: CellKind, outputs: vscode.CellOutput[], metadata: vscode.NotebookCellMetadata | undefined): void {
insert(index: number, content: string | string[], language: string, type: CellKind, outputs: vscode.CellOutput[], metadata: vscode.NotebookCellMetadata | undefined): void {
this._throwIfFinalized();

const sourceArr = Array.isArray(content) ? content : content.split(/\r|\n|\r\n/g);
let cell = {
source: [content],
source: sourceArr,
language,
cellKind: type,
outputs: (outputs as any[]), // TODO@rebornix
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/notebook/browser/notebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
position: absolute;
display: flex;
opacity: 0;
transition: opacity 0.2s ease-in-out;
}

.monaco-workbench .part.editor > .content .notebook-editor > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container:hover {
Expand Down

0 comments on commit 9f48b00

Please sign in to comment.