Skip to content

Conversation

@karrtikr
Copy link

@karrtikr karrtikr commented Jan 11, 2022

Closes #18184

@karrtikr karrtikr added no-changelog No news entry required skip tests Updates to tests unnecessary labels Jan 11, 2022
Copy link
Author

@karrtikr karrtikr left a comment

Choose a reason for hiding this comment

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

@rchiodo FYI this class was not being used anywhere and is using outdated VSCode APIs, so I assume it's okay to remove it?

Comment on lines -1102 to -1108
export const IVSCodeNotebook = Symbol('IVSCodeNotebook');
export interface IVSCodeNotebook {
readonly notebookDocuments: ReadonlyArray<NotebookDocument>;
readonly onDidOpenNotebookDocument: Event<NotebookDocument>;
readonly onDidCloseNotebookDocument: Event<NotebookDocument>;
createConcatTextDocument(notebook: NotebookDocument, selector?: DocumentSelector): NotebookConcatTextDocument;
}
Copy link
Author

Choose a reason for hiding this comment

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

.

Comment on lines -1 to -19
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import { inject, injectable } from 'inversify';
import { DocumentSelector, Event, EventEmitter, workspace } from 'vscode';
import type { notebook, NotebookConcatTextDocument, NotebookDocument } from 'vscode-proposed';
import { UseProposedApi } from '../constants';
import { IApplicationEnvironment, IVSCodeNotebook } from './types';

@injectable()
export class VSCodeNotebook implements IVSCodeNotebook {
public get onDidOpenNotebookDocument(): Event<NotebookDocument> {
const onDidOpenNotebookDocument =
this.notebook.onDidOpenNotebookDocument ?? (workspace as any).onDidOpenNotebookDocument;
return this.canUseNotebookApi ? onDidOpenNotebookDocument : new EventEmitter<NotebookDocument>().event;
}
public get onDidCloseNotebookDocument(): Event<NotebookDocument> {
const onDidCloseNotebookDocument =
this.notebook.onDidCloseNotebookDocument ?? (workspace as any).onDidCloseNotebookDocument;
Copy link
Author

Choose a reason for hiding this comment

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

.

@karrtikr
Copy link
Author

I'm merging this PR but do let me know if there's an issue!

@karrtikr karrtikr merged commit b5557f4 into microsoft:main Jan 11, 2022
@karrtikr karrtikr deleted the enabledApiProposals branch January 11, 2022 17:17
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
…oft/vscode-python#18269)

* Migrate over to using `enabledApiProposals` in `package.json`

* Update webpack build for browser

* Upgrade vscode engine

* Remove unused notebook class

* Remove unnecessary proposed API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required skip tests Updates to tests unnecessary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate over to enabledApiProposals

1 participant