Skip to content

Commit

Permalink
finalize LanguageStatusItem API, #129037
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Feb 8, 2022
1 parent b5c20c8 commit 17ed7bf
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 102 deletions.
3 changes: 0 additions & 3 deletions extensions/json-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion extensions/typescript-language-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"enabledApiProposals": [
"inlayHints",
"languageStatus",
"markdownStringBaseUri",
"resolvers",
"workspaceTrust"
Expand Down
1 change: 0 additions & 1 deletion extensions/vscode-api-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"fsChunks",
"inlayHints",
"inlineCompletions",
"languageStatus",
"markdownStringBaseUri",
"notebookCellExecutionState",
"notebookConcatTextDocument",
Expand Down
1 change: 0 additions & 1 deletion src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
84 changes: 84 additions & 0 deletions src/vscode-dts/vscode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
*
Expand Down
95 changes: 0 additions & 95 deletions src/vscode-dts/vscode.proposed.languageStatus.d.ts

This file was deleted.

3 comments on commit 17ed7bf

@bpasero
Copy link
Member

@bpasero bpasero commented on 17ed7bf Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi WARN Via 'product.json#extensionEnabledApiProposals' extension 'ms-vscode.anycode' wants API proposal 'languageStatus' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.

@jrieken
Copy link
Member Author

@jrieken jrieken commented on 17ed7bf Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - we first need new insiders and than republish extensions

@bpasero
Copy link
Member

@bpasero bpasero commented on 17ed7bf Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.