mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
content provider registration without static contribution.
This commit is contained in:
@@ -304,6 +304,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN
|
||||
options?: {
|
||||
transientOutputs: boolean;
|
||||
transientMetadata: { [K in keyof NotebookCellMetadata]?: boolean };
|
||||
viewOptions?: { displayName: string; filenamePattern: vscode.GlobPattern | { include: vscode.GlobPattern; exclude: vscode.GlobPattern }; exclusive?: boolean; };
|
||||
}
|
||||
): vscode.Disposable {
|
||||
|
||||
@@ -332,7 +333,14 @@ export class ExtHostNotebookController implements ExtHostNotebookShape, ExtHostN
|
||||
|
||||
const supportBackup = !!provider.backupNotebook;
|
||||
|
||||
this._proxy.$registerNotebookProvider({ id: extension.identifier, location: extension.extensionLocation, description: extension.description }, viewType, supportBackup, { transientOutputs: options?.transientOutputs || false, transientMetadata: options?.transientMetadata || {} });
|
||||
const viewOptionsFilenamePattern = typeConverters.NotebookExclusiveDocumentPattern.from(options?.viewOptions?.filenamePattern);
|
||||
console.warn(`Notebook content provider view options file name pattern is valid ${options?.viewOptions?.filenamePattern}`);
|
||||
|
||||
this._proxy.$registerNotebookProvider({ id: extension.identifier, location: extension.extensionLocation, description: extension.description }, viewType, supportBackup, {
|
||||
transientOutputs: options?.transientOutputs || false,
|
||||
transientMetadata: options?.transientMetadata || {},
|
||||
viewOptions: options?.viewOptions && viewOptionsFilenamePattern ? { displayName: options.viewOptions.displayName, filenamePattern: viewOptionsFilenamePattern, exclusive: options.viewOptions.exclusive || false } : undefined
|
||||
});
|
||||
|
||||
return new extHostTypes.Disposable(() => {
|
||||
listener.dispose();
|
||||
|
||||
Reference in New Issue
Block a user