-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Migrate over to using enabledApiProposals
in package.json
#18269
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
Conversation
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.
@rchiodo FYI this class was not being used anywhere and is using outdated VSCode APIs, so I assume it's okay to remove it?
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; | ||
} |
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.
.
// 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; |
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.
.
I'm merging this PR but do let me know if there's an issue! |
…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
Closes #18184