vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Support something like the language status UI for workspace status

Open mjbvz opened this issue 11 months ago • 3 comments

The LanguageStatusItem api provides a nice, consolidated way to show language specific information based on the currently active file

However some status info is relevant to the entire workspace instead of just the active file. I'd like to have an equivalent of LanguageStatusItem for these workspace wide items

Currently the workarounds are:

  • Use a LanguageStatusItem that always shows. This means the language status UI will have a mix of workspace and language info

  • Use normal workspace status items. These work but unfortunately can't be grouped like the LanguageStatusItem api provides

mjbvz avatar Jan 13 '25 21:01 mjbvz

Two quick proposals:

WorkspaceStatusItem

Create a new WorkspaceStatusItem API similar to LanguageStatusItem but for workspace-wide information

We would also create a new workspace status UI element in the left side of the status bar

StatusBarItem.group

Add a way to group existing status bar items under a top level item, with a UI similar to the language status item

mjbvz avatar Jan 13 '25 21:01 mjbvz

cc @bpasero with whom I have discussed something very similar today

jrieken avatar Jan 14 '25 12:01 jrieken

After talking with @jrieken, we're currently learning towards the WorkspaceStatusItem. Will look into this next iteration

mjbvz avatar Jan 15 '25 19:01 mjbvz

@jrieken For implementing this, I'd like to reuse as much of the language status item code as possible. What do you think about this proposal:

  • Split the common parts of the LanguageStatus class out into a new class called something like GroupedStatusBarItem

  • Implement a new class WorkbenchStatus using GroupedStatusBarItem

  • Implement a new IWorkspaceStatusService based on ILanguageStatusService

mjbvz avatar Jan 21 '25 18:01 mjbvz

Yeah, that sounds like a reasonable plan

jrieken avatar Jan 22 '25 08:01 jrieken

Hold off on verifying a day or so until I can adopt this new API for copilot

mjbvz avatar Mar 25 '25 15:03 mjbvz