add an API proposal for DocumentFilter#notebookType, https://github.com/microsoft/vscode/issues/141143

This commit is contained in:
Johannes Rieken 2022-02-10 17:02:40 +01:00
parent b239683e79
commit 609eea3a30
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798
5 changed files with 24 additions and 1 deletions

View file

@ -223,6 +223,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
if (typeof filter.exclusive === 'boolean') {
checkProposedApiEnabled(extension, 'documentFiltersExclusive');
}
if (typeof filter.notebookType === 'string') {
checkProposedApiEnabled(extension, 'notebookDocumentSelector');
}
}
return selector;
};

View file

@ -336,6 +336,7 @@ export interface IDocumentFilterDto {
scheme?: string;
pattern?: string | IRelativePattern;
exclusive?: boolean;
notebookType?: string;
}
export interface ISignatureHelpProviderMetadataDto {

View file

@ -148,7 +148,8 @@ export namespace DocumentSelector {
language: selector.language,
scheme: _transformScheme(selector.scheme, uriTransformer),
pattern: GlobPattern.from(selector.pattern) ?? undefined,
exclusive: selector.exclusive
exclusive: selector.exclusive,
notebookType: selector.notebookType
};
}

View file

@ -34,6 +34,7 @@ export const allApiProposals = Object.freeze({
notebookControllerKind: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerKind.d.ts',
notebookDebugOptions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDebugOptions.d.ts',
notebookDeprecated: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts',
notebookDocumentSelector: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDocumentSelector.d.ts',
notebookEditor: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookEditor.d.ts',
notebookEditorDecorationType: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookEditorDecorationType.d.ts',
notebookEditorEdit: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookEditorEdit.d.ts',

View file

@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/141143
export interface DocumentFilter {
/**
* The {@link NotebookDocument.notebookType type} of a notebook, like `jupyter`
*/
readonly notebookType?: string;
}
}