-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add notebookWorkspaceEdit api proposal #149128
Conversation
Splits a new `notebookWorkspaceEdit` out of the existing `notebookEditorEdit` proposal. The notebookWorkspaceEdit reflects the api that we believe should be finalized instead of `notebookEditorEdit`. It lets extensions use workspaceedits to change cells in a notebook or replace the metadata for a notebook document As part of this change, I've also marked all of the `notebookEditorEdit` apis as deprecated (except for `replaceNotebookMetadata` which exists in the new proposal too)
@@ -741,7 +778,7 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit { | |||
return this._edits.some(edit => edit._type === FileEditType.Text && edit.uri.toString() === uri.toString()); | |||
} | |||
|
|||
set(uri: URI, edits: TextEdit[]): void { | |||
set(uri: URI, edits: TextEdit[] | unknown): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for make TS happy with new proposal
* @param uri A resource identifier. | ||
* @param edits An array of text or notebook edits. | ||
*/ | ||
set(uri: Uri, edits: TextEdit[] | NotebookEdit[]): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also likely update WorkspaceEdit.get
and WorkspaceEdit.entries
to return Array<TextEdit | NotebookEdit>
This would be a breaking change since existing callers will not know how to deal with a NotebookEdit
. Alternatively we can keep get
and entries
returning TextEdit
and add new apis that expose all edits
* Add notebookWorkspaceEdit api proposal Splits a new `notebookWorkspaceEdit` out of the existing `notebookEditorEdit` proposal. The notebookWorkspaceEdit reflects the api that we believe should be finalized instead of `notebookEditorEdit`. It lets extensions use workspaceedits to change cells in a notebook or replace the metadata for a notebook document As part of this change, I've also marked all of the `notebookEditorEdit` apis as deprecated (except for `replaceNotebookMetadata` which exists in the new proposal too) * Export type from extHost
Splits a new
notebookWorkspaceEdit
out of the existingnotebookEditorEdit
proposal.The
notebookWorkspaceEdit
proposal captures the api that we believe should be finalized instead of the existingnotebookEditorEdit
proposal. This new proposal extensions use workspaceedits to change cells in a notebook or replace the metadata for a notebook documentAs part of this change, I've also marked all of the
notebookEditorEdit
apis as deprecated (except forreplaceNotebookMetadata
which exists in the new proposal too)