Skip to content
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

Merged
merged 2 commits into from
May 16, 2022
Merged

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented May 9, 2022

Splits a new notebookWorkspaceEdit out of the existing notebookEditorEdit proposal.

The notebookWorkspaceEdit proposal captures the api that we believe should be finalized instead of the existing notebookEditorEdit proposal. This new proposal 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)

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)
@mjbvz mjbvz added this to the May 2022 milestone May 9, 2022
@mjbvz mjbvz requested review from rebornix and jrieken May 9, 2022 23:34
@mjbvz mjbvz self-assigned this May 9, 2022
@@ -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 {
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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

@mjbvz mjbvz merged commit 3f531a7 into main May 16, 2022
@mjbvz mjbvz deleted the dev/mjbvz/notebookWorkspaceEdit branch May 16, 2022 18:25
Mingpan pushed a commit to Mingpan/vscode that referenced this pull request May 23, 2022
* 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
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants