Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Rieken <johannes.rieken@gmail.com>2022-07-06 19:33:04 +0300
committerGitHub <noreply@github.com>2022-07-06 19:33:04 +0300
commitf413297170178f16ab218202153b629d59a98be1 (patch)
tree3e370156bfe976d1e7526f07957403eec8d6f086 /src/vs/workbench/contrib/notebook
parent0df86c37b602d08bab3e8def45dd445d36f55fc2 (diff)
joh/plastic fowl (#154275)
* * derive workspace dto with util * be strict when defining reference version ids (must be set to a value or undefined) * relax `ResourceNotebookCellEdit`
Diffstat (limited to 'src/vs/workbench/contrib/notebook')
-rw-r--r--src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts7
-rw-r--r--src/vs/workbench/contrib/notebook/common/notebookCommon.ts10
2 files changed, 13 insertions, 4 deletions
diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts
index 951fbe0e2e2..a024bbe93a6 100644
--- a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts
+++ b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.ts
@@ -17,7 +17,7 @@ import { FindMatch, IModelDecorationOptions, IModelDeltaDecoration, TrackedRange
import { MultiModelEditStackElement, SingleModelEditStackElement } from 'vs/editor/common/model/editStack';
import { IntervalNode, IntervalTree } from 'vs/editor/common/model/intervalTree';
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
-import { WorkspaceTextEdit } from 'vs/editor/common/languages';
+import { IWorkspaceTextEdit } from 'vs/editor/common/languages';
import { ITextModelService } from 'vs/editor/common/services/resolverService';
import { FoldingRegions } from 'vs/editor/contrib/folding/browser/foldingRanges';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -924,14 +924,15 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
return;
}
- const textEdits: WorkspaceTextEdit[] = [];
+ const textEdits: IWorkspaceTextEdit[] = [];
this._lastNotebookEditResource.push(matches[0].cell.uri);
matches.forEach(match => {
match.matches.forEach((singleMatch, index) => {
if ((singleMatch as OutputFindMatch).index === undefined) {
textEdits.push({
- edit: { range: (singleMatch as FindMatch).range, text: texts[index] },
+ versionId: undefined,
+ textEdit: { range: (singleMatch as FindMatch).range, text: texts[index] },
resource: match.cell.uri
});
}
diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts
index d0ccff06ccd..a95ecc6fb84 100644
--- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts
+++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts
@@ -17,7 +17,7 @@ import { ISplice } from 'vs/base/common/sequence';
import { URI, UriComponents } from 'vs/base/common/uri';
import { ILineChange } from 'vs/editor/common/diff/diffComputer';
import * as editorCommon from 'vs/editor/common/editorCommon';
-import { Command } from 'vs/editor/common/languages';
+import { Command, WorkspaceEditMetadata } from 'vs/editor/common/languages';
import { IReadonlyTextBuffer } from 'vs/editor/common/model';
import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility';
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
@@ -497,6 +497,14 @@ export interface ICellMoveEdit {
export type IImmediateCellEditOperation = ICellOutputEditByHandle | ICellPartialMetadataEditByHandle | ICellOutputItemEdit | ICellPartialInternalMetadataEdit | ICellPartialInternalMetadataEditByHandle | ICellPartialMetadataEdit;
export type ICellEditOperation = IImmediateCellEditOperation | ICellReplaceEdit | ICellOutputEdit | ICellMetadataEdit | ICellPartialMetadataEdit | ICellPartialInternalMetadataEdit | IDocumentMetadataEdit | ICellMoveEdit | ICellOutputItemEdit | ICellLanguageEdit;
+
+export interface IWorkspaceNotebookCellEdit {
+ metadata?: WorkspaceEditMetadata;
+ resource: URI;
+ notebookVersionId: number | undefined;
+ cellEdit: ICellPartialMetadataEdit | IDocumentMetadataEdit | ICellReplaceEdit;
+}
+
export interface NotebookData {
readonly cells: ICellDto2[];
readonly metadata: NotebookDocumentMetadata;