You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow language extensions to provide status informationΒ #129037
Many language extensions add status bar entries for various information tidbits, like version, language server status, project etc. There is many inconsistencies for how this happens like alignment isn't always in sync with the language name or visibility isn't in sync with the active editor.
We should help extensions do a better job by adding a dedicated "language status" API, some kind of LanguageStatusProvider which we query whenever the editor changes. In its simplest form language status can be text, detail (supporting codicons and md), and severity.
Good stuff.
Not sure about text and detail, I would suggest to go with just message: string | MarkdownString.
I imagine this to be shown in a hover over the language mode status bar entry (e.g. 'JSON'). As there can potentially be multiple providers active for a given document, the hover would combine all the messages by concatenating them.
Looks promising. Here's the information we'd potentially like to show for JS/TS:
The current TS version (plus a way to switch versions)
The state of TS server.
Are we spinning up a full server? Right now we show initializing JS/TS language features progress in the status bar for this
Are we in partial only mode. If this is the case, we'd like to tell users that operations such as workspace symbol search may be incomplete
Potentially if logging is enabled and a quick way to jump to the log file
Additionally, it would be nice if we could customize the displayed information per-file instead of showing the same status for all files of given language. For JS/TS, this could be:
The tsconfig/jsconfig that the current file belongs to (and a way to quickly go to that config file)
If multiple extensions can contribute to the language status, it may also make sense to move some ESLint information into the language status
So my high level questions:
Should this API be per-file or per-language?
The current API uses a pull model but if we instead had a push model, we could leave this decision up to extensions like we do for status bar items
Should Language Status be a single item or an array of items?
Can multiple extensions contribute to a language status?
Reacted by Andrii Dieiev, Frank Mosca and ExE Boss
Extensions can always take advantage of the existing vscode API to add additional status bar entries, with command handler, icons, colors, menus etc.
That's why I suggest that for the beginning we keep it simple and introduce a LanguageStatusProvider returning a MarkdownString that we can show as hover over the language selector. Thats something we currently can't do through API. Such API is also straightforward to adopt in LSP.
Keep it proposed for a while and I can adopt it in HTML, CSS and JSON to gain some UX experience
simple and introduce a LanguageStatusProvider returning a MarkdownString.
I think we need more than just a message because we need to show some kind of anchor in the status bar. I initially tried to hijack the language item for that but it has the "Change Language" message and command.
hi Johannes Rieken (@jrieken), I'm trying to adopt this API in Java language support and it works well π. And I just find if we pin an item and we mark it busy, the spinning icon will appear in both language status item (the left one) and pinned item (the right one).
IMO it's a little duplicated and it's better to show the busy icon only in the language status item (the left one) to help users focus on the item. Does it make sense?
Andy Jordan (@andschwa) The default in my case seems to be pinned. So in my screenshot, the default is only to show the left one, but no the right one.
But if you choose to unpin this item, the right one appears. It works when we just change the severity, text, etc. , but if we mark it busy, duplicate busy icons appear.
Here is a suggestion about the visibility, sorry for disturbing. π
We find abnormal severity (error or warning) for unpinned status (which is the default behavior) is not easy to find, compared to the pinned item.
pinned error:
unpinned error:
Users will find the status easier for the pinned item than the unpinned item, since the background is different. Can we consider changing the background color of the pinned item as well? (or another way to help users find this status)
Activity
jrieken commentedon Jul 20, 2021
API sketch
jrieken commentedon Jul 20, 2021
fyi Matt Bierner (@mjbvz)
aeschli commentedon Jul 20, 2021
Good stuff.
Not sure about
textanddetail, I would suggest to go with justmessage: string | MarkdownString.I imagine this to be shown in a hover over the language mode status bar entry (e.g. 'JSON'). As there can potentially be multiple providers active for a given document, the hover would combine all the messages by concatenating them.
mjbvz commentedon Jul 20, 2021
Looks promising. Here's the information we'd potentially like to show for JS/TS:
initializing JS/TS language featuresprogress in the status bar for thisAdditionally, it would be nice if we could customize the displayed information per-file instead of showing the same status for all files of given language. For JS/TS, this could be:
If multiple extensions can contribute to the language status, it may also make sense to move some ESLint information into the language status
So my high level questions:
Language Statusbe a single item or an array of items?egamma commentedon Jul 21, 2021
//CC Dirk BΓ€umer (@dbaeumer)
first cut for language status API proposal, #129037
aeschli commentedon Jul 21, 2021
Extensions can always take advantage of the existing vscode API to add additional status bar entries, with command handler, icons, colors, menus etc.
That's why I suggest that for the beginning we keep it simple and introduce a
LanguageStatusProviderreturning aMarkdownStringthat we can show as hover over the language selector. Thats something we currently can't do through API. Such API is also straightforward to adopt in LSP.Keep it proposed for a while and I can adopt it in HTML, CSS and JSON to gain some UX experience
jrieken commentedon Jul 21, 2021
I think we need more than just a message because we need to show some kind of anchor in the status bar. I initially tried to hijack the language item for that but it has the "Change Language" message and command.
120 remaining items
some more API doc, #129037
finalize `LanguageStatusItem` API, #129037
jrieken commentedon Feb 21, 2022
To verify simply make sure that createLanguageStatusItem is in
vscode.d.tsCsCherrYY commentedon Mar 15, 2022
hi Johannes Rieken (@jrieken), I'm trying to adopt this API in Java language support and it works well π. And I just find if we pin an item and we mark it busy, the spinning icon will appear in both language status item (the left one) and pinned item (the right one).
IMO it's a little duplicated and it's better to show the busy icon only in the language status item (the left one) to help users focus on the item. Does it make sense?
jrieken commentedon Mar 15, 2022
I agree. Can you please file a separate bug for that. Thanks
CsCherrYY commentedon Mar 15, 2022
Johannes Rieken (@jrieken) thanks for the swift reply! issue created here: #145115
andyleejordan commentedon Mar 15, 2022
Hey Shi Chen (@CsCherrYY) are you saying the left one isn't pinned? How did you get it to show up like that?
Here it is unpinned for us (it only shows up under the
{}icon, and unpinned is the default, which is annoying our users):And after manually pinning it:
CsCherrYY commentedon Mar 16, 2022
Andy Jordan (@andschwa) The default in my case seems to be pinned. So in my screenshot, the default is only to show the left one, but no the right one.
But if you choose to unpin this item, the right one appears. It works when we just change the severity, text, etc. , but if we mark it busy, duplicate busy icons appear.
CsCherrYY commentedon Mar 24, 2022
Here is a suggestion about the visibility, sorry for disturbing. π
We find abnormal severity (error or warning) for unpinned status (which is the default behavior) is not easy to find, compared to the pinned item.
pinned error:

unpinned error:

Users will find the status easier for the pinned item than the unpinned item, since the background is different. Can we consider changing the background color of the pinned item as well? (or another way to help users find this status)