mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove API compatibility layer for VS Code notebook extensions (#21225)
This commit is contained in:
@@ -31,8 +31,6 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
import { diffSets, diffMaps } from 'vs/base/common/collections';
|
||||
import { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { CELL_URI_PATH_PREFIX } from 'sql/workbench/common/constants';
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
import { ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -383,12 +381,6 @@ export class MainThreadDocumentsAndEditors {
|
||||
}
|
||||
|
||||
private _toModelAddData(model: ITextModel): IModelAddedData {
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Check if this TextModel is part of a notebook cell
|
||||
let notebookUri: URI;
|
||||
if (model.uri.scheme === Schemas.untitled && model.uri.path.startsWith(CELL_URI_PATH_PREFIX)) {
|
||||
notebookUri = this._notebookService.getNotebookURIForCell(model.uri);
|
||||
}
|
||||
return {
|
||||
uri: model.uri,
|
||||
versionId: model.getVersionId(),
|
||||
@@ -396,7 +388,6 @@ export class MainThreadDocumentsAndEditors {
|
||||
EOL: model.getEOL(),
|
||||
languageId: model.getLanguageId(),
|
||||
isDirty: this._textFileService.isDirty(model.uri),
|
||||
notebookUri: notebookUri
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ExtHostContext, ExtHostNotebookRenderersShape, MainThreadNotebookRender
|
||||
import { IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
|
||||
import { INotebookRendererMessagingService } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService';
|
||||
|
||||
// @extHostNamedCustomer(MainContext.MainThreadNotebookRenderers) {{SQL CARBON EDIT}}
|
||||
// @extHostNamedCustomer(MainContext.MainThreadNotebookRenderers) {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
export class MainThreadNotebookRenderers extends Disposable implements MainThreadNotebookRenderersShape {
|
||||
private readonly proxy: ExtHostNotebookRenderersShape;
|
||||
|
||||
|
||||
@@ -93,15 +93,8 @@ import { matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
import { combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import { checkProposedApiEnabled, ExtensionIdentifierSet, isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { DebugConfigurationProviderTriggerKind } from 'vs/workbench/contrib/debug/common/debug';
|
||||
// import { ExtHostNotebookProxyKernels } from 'vs/workbench/api/common/extHostNotebookProxyKernels'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
|
||||
import { ExtHostNotebook } from 'sql/workbench/api/common/extHostNotebook'; // {{SQL CARBON EDIT}}
|
||||
import { docCreationFailedError, functionalityNotSupportedError, invalidArgumentsError } from 'sql/base/common/locConstants';
|
||||
import { ExtHostNotebookDocumentsAndEditors } from 'sql/workbench/api/common/extHostNotebookDocumentsAndEditors';
|
||||
import { VSCodeNotebookEditor } from 'sql/workbench/api/common/notebooks/vscodeNotebookEditor';
|
||||
import { VSCodeNotebookDocument } from 'sql/workbench/api/common/notebooks/vscodeNotebookDocument';
|
||||
import { convertToADSNotebookContents } from 'sql/workbench/api/common/notebooks/notebookUtils';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { notebooksNotSupportedError } from 'sql/base/common/locConstants';
|
||||
|
||||
export interface IExtensionRegistries {
|
||||
mine: ExtensionDescriptionRegistry;
|
||||
@@ -115,7 +108,7 @@ export interface IExtensionApiFactory {
|
||||
/**
|
||||
* This method instantiates and returns the extension API surface
|
||||
*/
|
||||
export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, extHostNotebook: ExtHostNotebook, extHostNotebookDocumentsAndEditors: ExtHostNotebookDocumentsAndEditors): IExtensionApiFactory { // {{SQL CARBON EDIT}} Add ExtHostNotebook
|
||||
export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): IExtensionApiFactory {
|
||||
|
||||
// services
|
||||
const initData = accessor.get(IExtHostInitDataService);
|
||||
@@ -206,6 +199,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
ExtHostContext.ExtHostNotebookDocuments,
|
||||
ExtHostContext.ExtHostNotebookEditors,
|
||||
ExtHostContext.ExtHostNotebookKernels,
|
||||
ExtHostContext.ExtHostNotebookProxyKernels,
|
||||
ExtHostContext.ExtHostNotebookRenderers,
|
||||
ExtHostContext.ExtHostNotebookProxyKernels,
|
||||
ExtHostContext.ExtHostInteractive
|
||||
@@ -224,9 +218,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
// Register API-ish commands
|
||||
ExtHostApiCommands.register(extHostCommands);
|
||||
|
||||
// {{SQL CARBON EDIT}} Used for creating stubbed out DecorationTypes for compatibility purposes
|
||||
const DecorationTypeKeys = new IdGenerator('VSCodeNotebookEditorDecorationType');
|
||||
|
||||
return function (extension: IExtensionDescription, extensionInfo: IExtensionRegistries, configProvider: ExtHostConfigProvider): typeof vscode {
|
||||
|
||||
// Check document selectors for being overly generic. Technically this isn't a problem but
|
||||
@@ -784,43 +775,32 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostWebviewViews.registerWebviewViewProvider(extension, viewId, provider, options?.webviewOptions);
|
||||
},
|
||||
get activeNotebookEditor(): vscode.NotebookEditor | undefined {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
let activeEditor = extHostNotebookDocumentsAndEditors.getActiveEditor();
|
||||
return activeEditor ? new VSCodeNotebookEditor(activeEditor) : undefined;
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidChangeActiveNotebookEditor(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeActiveVSCodeEditor(listener, thisArgs, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
get visibleNotebookEditors() {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.getAllEditors().map(editor => new VSCodeNotebookEditor(editor));
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
return undefined;
|
||||
},
|
||||
get onDidChangeVisibleNotebookEditors() {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVisibleVSCodeEditors;
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
return undefined;
|
||||
},
|
||||
onDidChangeNotebookEditorSelection(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeEditorSelection(listener, thisArgs, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidChangeNotebookEditorVisibleRanges(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeEditorRanges(listener, thisArgs, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
showNotebookDocument(uriOrDocument: URI | vscode.NotebookDocument, options?: vscode.NotebookDocumentShowOptions): Thenable<vscode.NotebookEditor> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
let targetUri: URI;
|
||||
if (URI.isUri(uriOrDocument)) {
|
||||
targetUri = uriOrDocument;
|
||||
} else {
|
||||
targetUri = uriOrDocument.uri;
|
||||
}
|
||||
return extHostNotebookDocumentsAndEditors.showNotebookDocument(targetUri, {
|
||||
viewColumn: options?.viewColumn,
|
||||
preserveFocus: options?.preserveFocus,
|
||||
preview: options?.preview
|
||||
}).then(editor => new VSCodeNotebookEditor(editor));
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
registerExternalUriOpener(id: string, opener: vscode.ExternalUriOpener, metadata: vscode.ExternalUriOpenerMetadata) {
|
||||
checkProposedApiEnabled(extension, 'externalUriOpener');
|
||||
@@ -945,51 +925,36 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
return extHostDocumentSaveParticipant.getOnWillSaveTextDocumentEvent(extension)(listener, thisArgs, disposables);
|
||||
},
|
||||
get notebookDocuments(): vscode.NotebookDocument[] {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.getAllDocuments().map(doc => new VSCodeNotebookDocument(doc.document));
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
async openNotebookDocument(uriOrType?: URI | string, content?: vscode.NotebookData): Promise<vscode.NotebookDocument> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
let uri: URI;
|
||||
if (URI.isUri(uriOrType)) {
|
||||
uri = uriOrType;
|
||||
await extHostNotebookDocumentsAndEditors.openNotebookDocument(uriOrType);
|
||||
} else if (typeof uriOrType === 'string') {
|
||||
uri = URI.revive(await extHostNotebookDocumentsAndEditors.createNotebookDocument(uriOrType, convertToADSNotebookContents(content)));
|
||||
} else {
|
||||
throw new Error(invalidArgumentsError);
|
||||
}
|
||||
let doc = extHostNotebookDocumentsAndEditors.getDocument(uri.toString())?.document;
|
||||
if (!doc) {
|
||||
throw new Error(docCreationFailedError);
|
||||
}
|
||||
return new VSCodeNotebookDocument(doc);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidSaveNotebookDocument(listener, thisArg, disposables) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidSaveVSCodeNotebookDocument(listener, thisArg, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidChangeNotebookDocument(listener, thisArg, disposables) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeNotebookDocument(listener, thisArg, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
get onDidOpenNotebookDocument(): Event<vscode.NotebookDocument> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidOpenVSCodeNotebookDocument;
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
get onDidCloseNotebookDocument(): Event<vscode.NotebookDocument> {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidCloseVSCodeNotebookDocument;
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
registerNotebookSerializer(viewType: string, serializer: vscode.NotebookSerializer, options?: vscode.NotebookDocumentContentOptions, registration?: vscode.NotebookRegistrationData) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebook.registerNotebookSerializer(viewType, serializer, options, extension.enabledApiProposals ? registration : undefined);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
registerNotebookContentProvider: (viewType: string, provider: vscode.NotebookContentProvider, options?: vscode.NotebookDocumentContentOptions, registration?: vscode.NotebookRegistrationData) => {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// checkProposedApiEnabled(extension);
|
||||
// return extHostNotebook.registerNotebookContentProvider(extension, viewType, provider, options, extension.enableProposedApi ? registration : undefined);
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidChangeConfiguration: (listener: (_: any) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => {
|
||||
return configProvider.onDidChangeConfiguration(listener, thisArgs, disposables);
|
||||
@@ -1226,42 +1191,28 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor, ex
|
||||
// namespace: notebook
|
||||
const notebooks: typeof vscode.notebooks = {
|
||||
createNotebookController(id: string, notebookType: string, label: string, handler?, rendererScripts?: vscode.NotebookRendererScript[]) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
let getDocHandler = (notebookUri: URI) => extHostNotebookDocumentsAndEditors.getDocument(notebookUri.toString())?.document;
|
||||
return extHostNotebook.createNotebookController(extension, id, notebookType, label, getDocHandler, handler, extension.enabledApiProposals ? rendererScripts : undefined);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
registerNotebookCellStatusBarItemProvider: (notebookType: string, provider: vscode.NotebookCellStatusBarItemProvider) => {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// return extHostNotebook.registerNotebookCellStatusBarItemProvider(extension, notebookType, provider);
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
createNotebookEditorDecorationType(options: vscode.NotebookDecorationRenderOptions): vscode.NotebookEditorDecorationType {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
// Returning this stub class for now, since we don't support renderer contributions yet
|
||||
return {
|
||||
key: DecorationTypeKeys.nextId(),
|
||||
dispose: () => undefined
|
||||
};
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
createRendererMessaging(rendererId) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
// Returning this stub class for now, since we don't support renderer contributions yet
|
||||
let receivedMessage = new Emitter<{ editor: vscode.NotebookEditor, message: any }>();
|
||||
let rendererMessaging: vscode.NotebookRendererMessaging = {
|
||||
onDidReceiveMessage: (listener, thisArg, disposables) => receivedMessage.event(listener, thisArg, disposables),
|
||||
postMessage: () => Promise.resolve(false)
|
||||
};
|
||||
return rendererMessaging;
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
onDidChangeNotebookCellExecutionState(listener, thisArgs?, disposables?) {
|
||||
// {{SQL CARBON EDIT}} Use our own notebooks
|
||||
return extHostNotebookDocumentsAndEditors.onDidChangeVSCodeExecutionState(listener, thisArgs, disposables);
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
},
|
||||
createNotebookProxyController(id: string, notebookType: string, label: string, handler: () => vscode.NotebookController | string | Thenable<vscode.NotebookController | string>) {
|
||||
// {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
throw new Error(functionalityNotSupportedError);
|
||||
// checkProposedApiEnabled(extension, 'notebookProxyController');
|
||||
// return extHostNotebookProxyKernels.createNotebookProxyController(extension, id, notebookType, label, handler);
|
||||
throw new Error(notebooksNotSupportedError);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1333,8 +1333,6 @@ export interface IModelAddedData {
|
||||
EOL: string;
|
||||
languageId: string;
|
||||
isDirty: boolean;
|
||||
// {{SQL CARBON EDIT}}
|
||||
notebookUri?: URI;
|
||||
}
|
||||
export interface ExtHostDocumentsShape {
|
||||
$acceptModelLanguageChanged(strURL: UriComponents, newLanguageId: string): void;
|
||||
|
||||
@@ -97,14 +97,6 @@ export class ExtHostDocumentsAndEditors implements ExtHostDocumentsAndEditorsSha
|
||||
}
|
||||
}
|
||||
if (!ref) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Add URI of the notebook that is using this document for a cell's editor.
|
||||
if (!data.notebook && data.notebookUri) {
|
||||
// We only use this notebook field for .NET Interactive's intellisense, which only uses the notebook's URI
|
||||
data.notebook = <vscode.NotebookDocument>{
|
||||
uri: URI.revive(data.notebookUri)
|
||||
};
|
||||
}
|
||||
ref = new Reference(new ExtHostDocumentData(
|
||||
this._extHostRpc.getProxy(MainContext.MainThreadDocuments),
|
||||
resource,
|
||||
|
||||
@@ -383,7 +383,7 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
|
||||
}
|
||||
|
||||
|
||||
export enum NotebookCellExecutionTaskState { // {{SQL CARBON EDIT}} Use for our Notebook executions
|
||||
enum NotebookCellExecutionTaskState {
|
||||
Init,
|
||||
Started,
|
||||
Resolved
|
||||
|
||||
@@ -7,8 +7,6 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry';
|
||||
import { NotebookEditorPriority, NotebookRendererEntrypoint, RendererMessagingSpec } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { Registry } from 'vs/platform/registry/common/platform'; // {{SQL CARBON EDIT}} Register notebooks in SQL code instead
|
||||
import { INotebookProviderRegistry, NotebookProviderRegistryId, ProviderDescriptionRegistration } from 'sql/workbench/services/notebook/common/notebookRegistry'; // {{SQL CARBON EDIT}} Register notebooks in SQL code instead
|
||||
|
||||
namespace NotebookEditorContribution {
|
||||
export const type = 'type';
|
||||
@@ -187,31 +185,6 @@ export const notebooksExtensionPoint = ExtensionsRegistry.registerExtensionPoint
|
||||
jsonSchema: notebookProviderContribution
|
||||
});
|
||||
|
||||
// {{SQL CARBON EDIT}} Convert VSCode notebook registrations into ADS equivalents
|
||||
const adsNotebookRegistry = Registry.as<INotebookProviderRegistry>(NotebookProviderRegistryId);
|
||||
notebooksExtensionPoint.setHandler(extensions => {
|
||||
for (let extension of extensions) {
|
||||
for (const notebookContribution of extension.value) {
|
||||
// Remove any leading regex characters from the filename pattern
|
||||
let extensions = notebookContribution.selector?.filter(ext => ext?.filenamePattern?.length > 0)
|
||||
.map(s => {
|
||||
let lastDotPosition = s.filenamePattern?.lastIndexOf('.');
|
||||
if (lastDotPosition >= 0) {
|
||||
return s.filenamePattern.slice(lastDotPosition);
|
||||
}
|
||||
return s.filenamePattern;
|
||||
});
|
||||
|
||||
let adsProvider: ProviderDescriptionRegistration = {
|
||||
provider: notebookContribution.type,
|
||||
fileExtensions: extensions ?? [],
|
||||
standardKernels: [] // The actual Kernels are the NotebookControllers that are contributed later
|
||||
};
|
||||
adsNotebookRegistry.registerProviderDescription(adsProvider);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
export const notebookRendererExtensionPoint = ExtensionsRegistry.registerExtensionPoint<INotebookRendererContribution[]>(
|
||||
{
|
||||
extensionPoint: 'notebookRenderer',
|
||||
|
||||
@@ -105,7 +105,6 @@ import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeat
|
||||
import { NotebookInfo } from 'vs/editor/common/languageFeatureRegistry';
|
||||
import { COMMENTEDITOR_DECORATION_KEY } from 'vs/workbench/contrib/comments/browser/commentReply';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { cellToolbarCompatibilityMessage } from 'sql/base/common/locConstants'; // {{SQL CARBON EDIT}}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------------------------- */
|
||||
@@ -767,20 +766,19 @@ configurationRegistry.registerConfiguration({
|
||||
// },
|
||||
// default: []
|
||||
// },
|
||||
[NotebookSetting.cellToolbarLocation]: {
|
||||
description: cellToolbarCompatibilityMessage, // {{SQL CARBON EDIT}}
|
||||
type: 'object',
|
||||
additionalProperties: {
|
||||
markdownDescription: nls.localize('notebook.cellToolbarLocation.viewType', "Configure the cell toolbar position for for specific file types"),
|
||||
type: 'string',
|
||||
enum: ['left', 'right', 'hidden']
|
||||
},
|
||||
default: {
|
||||
'default': 'right'
|
||||
},
|
||||
tags: ['notebookLayout']
|
||||
},
|
||||
// {{SQL CARBON EDIT}} Remove unused VS Code Notebook configurations
|
||||
// [NotebookSetting.cellToolbarLocation]: {
|
||||
// description: nls.localize('notebook.cellToolbarLocation.description', "Where the cell toolbar should be shown, or whether it should be hidden."),
|
||||
// type: 'object',
|
||||
// additionalProperties: {
|
||||
// markdownDescription: nls.localize('notebook.cellToolbarLocation.viewType', "Configure the cell toolbar position for for specific file types"),
|
||||
// type: 'string',
|
||||
// enum: ['left', 'right', 'hidden']
|
||||
// },
|
||||
// default: {
|
||||
// 'default': 'right'
|
||||
// },
|
||||
// tags: ['notebookLayout']
|
||||
// },
|
||||
// [ShowCellStatusBar]: {
|
||||
// description: nls.localize('notebook.showCellStatusbar.description', "Whether the cell status bar should be shown."),
|
||||
// type: 'string',
|
||||
|
||||
@@ -16,7 +16,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { BareFontInfo } from 'vs/editor/common/config/fontInfo';
|
||||
// import { localize } from 'vs/nls'; {{SQL CARBON EDIT}} Notebook registration handled in SQL code
|
||||
// import { localize } from 'vs/nls'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IResourceEditorInput } from 'vs/platform/editor/common/editor';
|
||||
@@ -38,7 +38,7 @@ import { NotebookEditorDescriptor, NotebookProviderInfo } from 'vs/workbench/con
|
||||
import { ComplexNotebookProviderInfo, INotebookContentProvider, INotebookSerializer, INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||
import { DiffEditorInputFactoryFunction, EditorInputFactoryFunction, IEditorResolverService, IEditorType, RegisteredEditorInfo, RegisteredEditorPriority, UntitledEditorInputFactoryFunction } from 'vs/workbench/services/editor/common/editorResolverService';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
// import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; {{SQL CARBON EDIT}} Notebook registration handled in SQL code
|
||||
// import { IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
|
||||
export class NotebookProviderInfoStore extends Disposable {
|
||||
|
||||
@@ -79,7 +79,7 @@ export class NotebookProviderInfoStore extends Disposable {
|
||||
}
|
||||
}));
|
||||
|
||||
// notebooksExtensionPoint.setHandler(extensions => this._setupHandler(extensions)); {{SQL CARBON EDIT}} Notebook registration handled in SQL code
|
||||
// notebooksExtensionPoint.setHandler(extensions => this._setupHandler(extensions)); {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
}
|
||||
|
||||
override dispose(): void {
|
||||
@@ -87,7 +87,7 @@ export class NotebookProviderInfoStore extends Disposable {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/* // {{SQL CARBON EDIT}} Notebook registration handled in SQL code
|
||||
/* // {{SQL CARBON EDIT}} Disable VS Code notebooks
|
||||
private _setupHandler(extensions: readonly IExtensionPointUser<INotebookEditorContribution[]>[]) {
|
||||
this._handled = true;
|
||||
const builtins: NotebookProviderInfo[] = [...this._contributedEditors.values()].filter(info => !info.extension);
|
||||
|
||||
@@ -317,6 +317,7 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager {
|
||||
MainContext.MainThreadNotebookDocuments,
|
||||
MainContext.MainThreadNotebookEditors,
|
||||
MainContext.MainThreadNotebookKernels,
|
||||
MainContext.MainThreadNotebookProxyKernels,
|
||||
MainContext.MainThreadNotebookRenderers,
|
||||
MainContext.MainThreadNotebookProxyKernels,
|
||||
MainContext.MainThreadInteractive
|
||||
|
||||
Reference in New Issue
Block a user