fix: enable text wrapping in parameter hints widget#293558
fix: enable text wrapping in parameter hints widget#293558kairosci wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Add white-space: pre-wrap, word-wrap and overflow-wrap properties to parameter hints .code and .signature classes to allow long parameter descriptions and signatures to wrap instead of overflowing. Fixes microsoft#142888
There was a problem hiding this comment.
Pull request overview
Enables wrapping for long content in the editor’s parameter hints (signature help) widget so signatures/descriptions don’t overflow the visible area.
Changes:
- Add wrapping-related CSS (
white-space: pre-wrap,word-wrap,overflow-wrap) to the parameter hints widget.codecontent. - Add word breaking rules to the
.signaturecontainer to prevent long signatures from overflowing.
| .monaco-editor .parameter-hints-widget .signature { | ||
| padding: 4px 5px; | ||
| position: relative; | ||
| word-wrap: break-word; | ||
| overflow-wrap: break-word; | ||
| } |
There was a problem hiding this comment.
The linked issue (#142888) describes hover tooltip content (“When I hover over … the displayed docstring is not wrapped”), but this change only updates the parameter hints widget CSS. Please confirm this PR is meant to fix parameter hints (signature help) and update the issue reference/description accordingly, or apply the fix to the hover widget if that’s the actual repro.
| .monaco-editor .parameter-hints-widget .code { | ||
| font-family: var(--vscode-parameterHintsWidget-editorFontFamily), var(--vscode-parameterHintsWidget-editorFontFamilyDefault); | ||
| white-space: pre-wrap; | ||
| word-wrap: break-word; | ||
| overflow-wrap: break-word; | ||
| } |
There was a problem hiding this comment.
Now that .parameter-hints-widget .code sets white-space: pre-wrap, the later rule .parameter-hints-widget .docs .code { white-space: pre-wrap; } becomes redundant for .code. Consider removing the redundant selector (or narrowing this .code rule to the signature area) to avoid confusion about which rule is expected to control wrapping.
Add white-space: pre-wrap, word-wrap and overflow-wrap properties to parameter hints .code and .signature classes to allow long parameter descriptions and signatures to wrap instead of overflowing.
This fixes an issue where long parameter hints were not wrapped, making them unreadable when they extended beyond the visible area. Only vertical scrolling was available, not horizontal, which made navigation difficult.
Fixes #142888