mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 01:25:36 -05:00
Enable VS Code extension APIs for getting opened notebook documents (#18043)
This commit is contained in:
@@ -94,6 +94,8 @@ import { matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
import { ExtHostNotebook } from 'sql/workbench/api/common/extHostNotebook';
|
||||
import { functionalityNotSupportedError } from 'sql/base/common/locConstants';
|
||||
import { ExtHostNotebookDocumentsAndEditors } from 'sql/workbench/api/common/extHostNotebookDocumentsAndEditors';
|
||||
import { VSCodeNotebookDocument } from 'sql/workbench/api/common/vscodeNotebookDocument';
|
||||
import { VSCodeNotebookEditor } from 'sql/workbench/api/common/vscodeNotebookEditor';
|
||||
|
||||
export interface IExtensionApiFactory {
|
||||
(extension: IExtensionDescription, registry: ExtensionDescriptionRegistry, configProvider: ExtHostConfigProvider): typeof vscode;
|
||||
@@ -716,10 +718,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostWebviewViews.registerWebviewViewProvider(extension, viewId, provider, options?.webviewOptions);
|
||||
},
|
||||
get activeNotebookEditor(): vscode.NotebookEditor | undefined {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// checkProposedApiEnabled(extension);
|
||||
// return extHostNotebook.activeNotebookEditor;
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return new VSCodeNotebookEditor(extHostNotebookDocumentsAndEditors.getActiveEditor());
|
||||
},
|
||||
onDidChangeActiveNotebookEditor(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
@@ -884,9 +884,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostDocumentSaveParticipant.getOnWillSaveTextDocumentEvent(extension)(listener, thisArgs, disposables);
|
||||
},
|
||||
get notebookDocuments(): vscode.NotebookDocument[] {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// return extHostNotebook.notebookDocuments.map(d => d.apiNotebook);
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.getAllDocuments().map(doc => new VSCodeNotebookDocument(doc.document));
|
||||
},
|
||||
async openNotebookDocument(uriOrType?: URI | string, content?: vscode.NotebookData) {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
|
||||
Reference in New Issue
Block a user