From 17ed7bf82c385b9b29a458109c6d6a76049856c7 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 8 Feb 2022 18:46:29 +0100 Subject: [PATCH] finalize `LanguageStatusItem` API, https://github.com/microsoft/vscode/issues/129037 --- .../json-language-features/package.json | 3 - .../typescript-language-features/package.json | 1 - extensions/vscode-api-tests/package.json | 1 - .../workbench/api/common/extHost.api.impl.ts | 1 - .../common/extensionsApiProposals.ts | 1 - src/vscode-dts/vscode.d.ts | 84 ++++++++++++++++ .../vscode.proposed.languageStatus.d.ts | 95 ------------------- 7 files changed, 84 insertions(+), 102 deletions(-) delete mode 100644 src/vscode-dts/vscode.proposed.languageStatus.d.ts diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index d41f0553d0567..983230c292857 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -23,9 +23,6 @@ "supported": true } }, - "enabledApiProposals": [ - "languageStatus" - ], "scripts": { "compile": "npx gulp compile-extension:json-language-features-client compile-extension:json-language-features-server", "watch": "npx gulp watch-extension:json-language-features-client watch-extension:json-language-features-server", diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index d79c8e9a8c162..f877075451b5f 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -9,7 +9,6 @@ "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", "enabledApiProposals": [ "inlayHints", - "languageStatus", "markdownStringBaseUri", "resolvers", "workspaceTrust" diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 877033d1495fd..26b7b50f4f1f6 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -18,7 +18,6 @@ "fsChunks", "inlayHints", "inlineCompletions", - "languageStatus", "markdownStringBaseUri", "notebookCellExecutionState", "notebookConcatTextDocument", diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 70bc817551b06..90d4b86792fdd 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -529,7 +529,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostLanguageFeatures.registerInlayHintsProvider(extension, selector, provider); }, createLanguageStatusItem(id: string, selector: vscode.DocumentSelector): vscode.LanguageStatusItem { - checkProposedApiEnabled(extension, 'languageStatus'); return extHostLanguages.createLanguageStatusItem(extension, id, selector); } }; diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index c15e1ba674ff1..14dfb5cfa07a9 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -28,7 +28,6 @@ export const allApiProposals = Object.freeze({ inlayHints: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlayHints.d.ts', inlineCompletions: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletions.d.ts', ipc: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts', - languageStatus: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatus.d.ts', markdownStringBaseUri: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownStringBaseUri.d.ts', notebookCellExecutionState: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecutionState.d.ts', notebookConcatTextDocument: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookConcatTextDocument.d.ts', diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 384686cc58cc3..8512ca27c933b 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -5628,6 +5628,82 @@ declare module 'vscode' { dispose(): void; } + /** + * Represents the severity of a language status item. + */ + export enum LanguageStatusSeverity { + Information = 0, + Warning = 1, + Error = 2 + } + + /** + * A language status item is the preferred way to present language status reports for the active text editors, + * such as selected linter or notifying about a configuration problem. + */ + export interface LanguageStatusItem { + + /** + * The identifier of this item. + */ + readonly id: string; + + /** + * The short name of this item, like 'Java Language Status', etc. + */ + name: string | undefined; + + /** + * A {@link DocumentSelector selector} that defines for what editors + * this item shows. + */ + selector: DocumentSelector; + + /** + * The severity of this item. + * + * Defaults to {@link LanguageStatusSeverity.Information information}. You can use this property to + * signal to users that there is a problem that needs attention, like a missing executable or an + * invalid configuration. + */ + severity: LanguageStatusSeverity; + + /** + * The text to show for the entry. You can embed icons in the text by leveraging the syntax: + * + * `My text $(icon-name) contains icons like $(icon-name) this one.` + * + * Where the icon-name is taken from the ThemeIcon [icon set](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing), e.g. + * `light-bulb`, `thumbsup`, `zap` etc. + */ + text: string; + + /** + * Optional, human-readable details for this item. + */ + detail?: string; + + /** + * Controls whether the item is shown as "busy". Defaults to `false`. + */ + busy: boolean; + + /** + * A {@linkcode Command command} for this item. + */ + command: Command | undefined; + + /** + * Accessibility information used when a screen reader interacts with this item + */ + accessibilityInformation?: AccessibilityInformation; + + /** + * Dispose and free associated resources. + */ + dispose(): void; + } + /** * Denotes a location of an editor in the window. Editors can be arranged in a grid * and each column represents one editor location in that grid by counting the editors @@ -11594,6 +11670,14 @@ declare module 'vscode' { */ export function createDiagnosticCollection(name?: string): DiagnosticCollection; + /** + * Creates a new {@link LanguageStatusItem language status item}. + * + * @param id The identifier of the item. + * @param selector The document selector that defines for what editors the item shows. + */ + export function createLanguageStatusItem(id: string, selector: DocumentSelector): LanguageStatusItem; + /** * Register a completion provider. * diff --git a/src/vscode-dts/vscode.proposed.languageStatus.d.ts b/src/vscode-dts/vscode.proposed.languageStatus.d.ts deleted file mode 100644 index 36665cbe92141..0000000000000 --- a/src/vscode-dts/vscode.proposed.languageStatus.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// https://github.com/microsoft/vscode/issues/129037 - -declare module 'vscode' { - - /** - * Represents the severity of a language status item. - */ - export enum LanguageStatusSeverity { - Information = 0, - Warning = 1, - Error = 2 - } - - /** - * A language status item is the preferred way to present language status reports for the active text editors, - * such as selected linter or notifying about a configuration problem. - */ - export interface LanguageStatusItem { - - /** - * The identifier of this item. - */ - readonly id: string; - - /** - * The short name of this item, like 'Java Language Status', etc. - */ - name: string | undefined; - - /** - * A {@link DocumentSelector selector} that defines for what editors - * this item shows. - */ - selector: DocumentSelector; - - /** - * The severity of this item. - * - * Defaults to {@link LanguageStatusSeverity.Information information}. You can use this property to - * signal to users that there is a problem that needs attention, like a missing executable or an - * invalid configuration. - */ - severity: LanguageStatusSeverity; - - /** - * The text to show for the entry. You can embed icons in the text by leveraging the syntax: - * - * `My text $(icon-name) contains icons like $(icon-name) this one.` - * - * Where the icon-name is taken from the ThemeIcon [icon set](https://code.visualstudio.com/api/references/icons-in-labels#icon-listing), e.g. - * `light-bulb`, `thumbsup`, `zap` etc. - */ - text: string; - - /** - * Optional, human-readable details for this item. - */ - detail?: string; - - /** - * Controls whether the item is shown as "busy". Defaults to `false`. - */ - busy: boolean; - - /** - * A {@linkcode Command command} for this item. - */ - command: Command | undefined; - - /** - * Accessibility information used when a screen reader interacts with this item - */ - accessibilityInformation?: AccessibilityInformation; - - /** - * Dispose and free associated resources. - */ - dispose(): void; - } - - namespace languages { - /** - * Creates a new {@link LanguageStatusItem language status item}. - * - * @param id The identifier of the item. - * @param selector The document selector that defines for what editors the item shows. - */ - export function createLanguageStatusItem(id: string, selector: DocumentSelector): LanguageStatusItem; - } -}