-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Expose the StatusBarEntryLocation parameter in the `createStatusBar…
#290253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Expose the StatusBarEntryLocation parameter in the `createStatusBar…
#290253
Conversation
…Item` function Added arguments to the `createStatusBarItem` function for creating grouped status bars in user-developed extensions. * Since `IStatusbarEntryLocation` must be accessible from the extHost API layer, moved it from browser to common. * Due to numerous uses of `StatusbarAlignment` within browser/statusbar.ts, retained its definition as a const value.
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR exposes the StatusBarEntryLocation parameter in the public createStatusBarItem API, allowing extensions to position status bar items relative to other items with fine-grained control over alignment and compact grouping.
Changes:
- Added
StatusBarEntryLocationinterface to the public API (vscode.d.ts) with support for positioning items relative to other items - Refactored internal status bar types into a new shared module (
types.ts) for better code organization - Updated all status bar-related type signatures throughout the codebase to use the new type definitions
- Added comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.d.ts | Added StatusBarEntryLocation interface and updated createStatusBarItem signatures to accept the new location type |
| src/vs/workbench/services/statusbar/common/types.ts | New file containing shared status bar type definitions including StatusBarAlignment enum, IStatusBarEntryLocation interface, and utility functions |
| src/vs/workbench/services/statusbar/browser/statusbar.ts | Refactored to import types from types.ts and created backward-compatible constants object for internal use |
| src/vs/workbench/browser/parts/statusbar/statusbarPart.ts | Updated imports and type signatures to use the refactored types |
| src/vs/workbench/browser/parts/statusbar/statusbarModel.ts | Updated imports and type signatures to use the refactored types |
| src/vs/workbench/browser/parts/editor/editorStatus.ts | Updated imports and type signatures to use the refactored types |
| src/vs/workbench/api/common/extHostTypes.ts | Removed StatusBarAlignment enum and asStatusBarItemIdentifier function (moved to types.ts) |
| src/vs/workbench/api/common/extHostStatusBar.ts | Updated to handle StatusBarEntryLocation in priority parameter with proper validation and conversion |
| src/vs/workbench/api/common/extHost.protocol.ts | Updated protocol signature to support IStatusBarEntryLocation in priority parameter |
| src/vs/workbench/api/common/extHost.api.impl.ts | Updated API implementation to handle the new StatusBarEntryLocation type in createStatusBarItem |
| src/vs/workbench/api/browser/statusBarExtensionPoint.ts | Updated to handle and process IStatusBarEntryLocation when creating status bar entries |
| src/vs/workbench/api/browser/mainThreadStatusBar.ts | Updated main thread implementation to support the new location type in the protocol |
| extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts | Added test verifying correct behavior when using StatusBarEntryLocation with compact positioning |
…Item` function
I am submitting a pull request to extend the function arguments in the createStatusBarItem section of the document below.
Document: https://code.visualstudio.com/api/references/vscode-api#window
There is no associated issue, but I can create one if needed.