Add configurable hover title verbosity for editor tabs#293510
Add configurable hover title verbosity for editor tabs#293510murataslan1 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
There was a problem hiding this comment.
Pull request overview
Adds a new workbench setting to control how verbose editor tab hover titles are, wiring it into the tab hover rendering via existing EditorInput.getTitle(Verbosity) behavior.
Changes:
- Introduces
workbench.editor.tabHoverMode(default/short/medium/long) as a configurable setting. - Maps
tabHoverModetoVerbosityand uses it when computing editor tab hover titles. - Adds a regression test to validate the mapping behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/common/editor.test.ts | Adds a unit test covering tab-hover-mode → Verbosity mapping. |
| src/vs/workbench/common/editor.ts | Introduces TabHoverMode and getEditorHoverVerbosity, and extends editor part config to include tabHoverMode. |
| src/vs/workbench/browser/workbench.contribution.ts | Registers the new workbench.editor.tabHoverMode setting and its descriptions. |
| src/vs/workbench/browser/parts/editor/editorTabsControl.ts | Applies the configured hover mode when generating tab hover titles. |
| src/vs/workbench/browser/parts/editor/editor.ts | Adds default + validation for tabHoverMode in editor part options. |
| localize('workbench.editor.tabHoverMode.default', "Show the title in the default format."), | ||
| localize('workbench.editor.tabHoverMode.short', "Show the file name."), | ||
| localize('workbench.editor.tabHoverMode.medium', "Show the file path relative to the workspace folder."), | ||
| localize('workbench.editor.tabHoverMode.long', "Show the absolute file path.") | ||
| ], | ||
| 'default': 'default', | ||
| 'description': localize('workbench.editor.tabHoverMode', "Controls the format of the title shown from editor tabs when hovered."), |
There was a problem hiding this comment.
The new workbench.editor.tabHoverMode setting descriptions are a bit misleading relative to the implemented behavior: default is mapped to Verbosity.LONG (absolute path), but the enum description says "default format" without indicating it matches the existing absolute-path tooltip. Consider updating the default enum description (and/or the setting description) to explicitly state what is shown for default, and tweak the phrasing "shown from editor tabs when hovered" to the more standard "shown when hovering over editor tabs" for clarity.
| localize('workbench.editor.tabHoverMode.default', "Show the title in the default format."), | |
| localize('workbench.editor.tabHoverMode.short', "Show the file name."), | |
| localize('workbench.editor.tabHoverMode.medium', "Show the file path relative to the workspace folder."), | |
| localize('workbench.editor.tabHoverMode.long', "Show the absolute file path.") | |
| ], | |
| 'default': 'default', | |
| 'description': localize('workbench.editor.tabHoverMode', "Controls the format of the title shown from editor tabs when hovered."), | |
| localize('workbench.editor.tabHoverMode.default', "Show the absolute file path (default)."), | |
| localize('workbench.editor.tabHoverMode.short', "Show the file name."), | |
| localize('workbench.editor.tabHoverMode.medium', "Show the file path relative to the workspace folder."), | |
| localize('workbench.editor.tabHoverMode.long', "Show the absolute file path.") | |
| ], | |
| 'default': 'default', | |
| 'description': localize('workbench.editor.tabHoverMode', "Controls the format of the title shown when hovering over editor tabs."), |
Fixes #163166.
Summary
workbench.editor.tabHoverModewith valuesdefault,short,medium,longdefaultmaps to long/absolute path style)Test Plan
npx tsx ./node_modules/mocha/bin/mocha --ui tdd src/vs/workbench/test/common/editor.test.ts --timeout 10000