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

API update for selection change #5516

Merged
merged 2 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/5515.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update to new selections API.
2 changes: 1 addition & 1 deletion src/test/datascience/notebook/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async function getServices() {

export async function selectCell(notebook: NotebookDocument, start: number, end: number) {
await window.showNotebookDocument(notebook, {
selection: new NotebookCellRange(start, end)
selections: [new NotebookCellRange(start, end)]
});
}

Expand Down
8 changes: 1 addition & 7 deletions types/vscode-proposed/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,6 @@ export interface NotebookEditor {
*/
readonly document: NotebookDocument;

/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled in just the selection change here. Pulling in the file was bringing in more kernel deprecations that I'd rather deal with the kernel push work.

@DonJayamanne Side note, we seem to have always had three copies of this file. Can we condense down to one? Wasn't sure if there was a reason for the copies, so I didn't do that in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall why we had 3, possibly something from core extension. Or maybe when we were using ts-node or the like...
Please do feel free to remove the duplicates.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DonJayamanne sounds good. Will do with kernel API update.

* @deprecated
*/
// todo@API should not be undefined, rather a default
readonly selection?: NotebookCell;

/**
* todo@API should replace selection
* The selections on this notebook editor.
Expand Down Expand Up @@ -418,7 +412,7 @@ export interface NotebookDocumentShowOptions {
viewColumn?: ViewColumn;
preserveFocus?: boolean;
preview?: boolean;
selection?: NotebookCellRange;
selections?: NotebookCellRange[];
}

export namespace notebook {
Expand Down
Loading