Skip to content

fix: the LSP console's server panel keeps its header readable at large fonts and narrow widths, and scrolls when it doesn't fit - #2211

Closed
lagergren wants to merge 1 commit into
redhat-developer:mainfrom
lagergren:fix/lsp-console-server-panel-header
Closed

lagergren wants to merge 1 commit into
redhat-developer:mainfrom
lagergren:fix/lsp-console-server-panel-header

Conversation

@lagergren

Copy link
Copy Markdown
Collaborator

Fixes #374
Fixes #324

What

The language server panel of the LSP console, which the settings page and the New Language Server dialog also use, named the server in a TitledBorder. At larger font sizes it overlapped the tabs (#374), and in a narrow console its title was clipped (#324). The tabs didn't scroll either, so their fields were cut off when they didn't fit.

Change

  • Header (LanguageServerView):
    • A JBLabel above the tabs replaces the titled border, in the IDE's font, with the full name in its tooltip.
    • It shortens the name with an ellipsis when the panel is narrow.
    • Its minimum width is 0, so a long name doesn't stop the console's splitter from making the panel narrower.
  • Scrolling (LanguageServerPanel.addTab):

Not in this PR:

  • The Workspace Folders tab of a user-defined server already wraps a JSON editor in a scroll pane. That's left as it was.
  • The header has no separator line and no 20 px indent, unlike the old border.

Tests

New LanguageServerViewLayoutTest (4 tests):

  • the header is a label with the server's name and tooltip, and no titled border is left;
  • at 200 px, the label is narrower than the name, and Swing's layout shows it shortened with "...";
  • a long name doesn't widen the panel's minimum width;
  • Server and Debug are scroll panes, and no JSON editor of Configuration or Installer is inside one.

Red-green: all 4 tests fail without the change and pass with it. An off-screen render at 700 px and 260 px shows the header and its ellipsis.

The new test passes headless on IC 2024.2, 2025.3 and IU 2026.3. The settings.* and console.* tests pass on all three platforms: 139 each.

Behaviour change

Before After
The server's name is the title of a border, which overlaps the tabs at large fonts and is clipped in a narrow console; the tabs don't scroll The name is a label above the tabs, shortened with an ellipsis and complete in its tooltip; the Server and Debug tabs scroll; the tabs with JSON editors or tables are unchanged

…e fonts and narrow widths, and scrolls when it doesn't fit

The page of a language server which is not user-defined, in the LSP
console and in the settings, named the language server in a TitledBorder.
At a large IDE font its tabs could overlap the title, and in a narrow LSP
console the title was clipped. Its tabs of fields didn't scroll, so a
field that didn't fit could only be reached by making the whole window
larger.

The header is now a JBLabel above the tabs, in the font of the IDE, so it
takes the height that font needs. It takes the width of the page and
shortens the name with an ellipsis when the page is narrower than the
name, with the whole name in its tooltip; its minimum width is 0, so the
name doesn't keep the LSP console's splitter, which honours minimum
sizes, from making the page narrower.

The tabs of fields, Server and Debug, are now in a borderless scroll pane
(ScrollPaneFactory), so they scroll when they don't fit. A tab whose
content fills it, the Configuration and Installer tabs with their JSON
editors and the Mappings tab with its tables, is not put in one: a JSON
editor scrolls itself, and a scroll pane around it breaks its keyboard
navigation (redhat-developer#655).

Fixes redhat-developer#374
Fixes redhat-developer#324
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c507db02-14a5-4627-9a95-135a40fb25ba
Commits

Reviewing files that changed from the base of the PR and between d592c89 and 7dccce7.

Files selected for processing: 3

  • src/main/java/com/redhat/devtools/lsp4ij/settings/LanguageServerView.java
  • src/main/java/com/redhat/devtools/lsp4ij/settings/ui/LanguageServerPanel.java
  • src/test/java/com/redhat/devtools/lsp4ij/settings/LanguageServerViewLayoutTest.java

@lagergren lagergren added the bug Something isn't working label Nov 24, 2026
@lagergren lagergren added this to the 0.30.2 milestone Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.65%. Comparing base (1b0b053) to head (7dccce7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2211      +/-   ##
==========================================
+ Coverage   54.59%   54.65%   +0.05%     
==========================================
  Files         834      834              
  Lines       35385    35398      +13     
  Branches     7300     7300              
==========================================
+ Hits        19320    19346      +26     
+ Misses      13223    13211      -12     
+ Partials     2842     2841       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

lagergren added a commit that referenced this pull request Nov 24, 2026
…to be the current one before it sets a value of that stop (#2216)

## What

`DAPSetExpressionSessionTest.testSetValueOfAVariableOfAnEarlierStopReportsItAndSendsNothing` failed on the Linux 2026.3 job of #2211, which doesn't touch DAP. Its message was "The value is set": Set Value of a variable of the second stop answered with an error.

`stopAgain()` waited for a new suspend context, and for a `DAPStackFrame` to be the current frame. The earlier stop's frame is one too, and the session takes the new suspend context before it makes a frame of it the current one. So the wait could end in between. `local("answer")` then took the variable of the earlier stop, which Set Value rightly reports as out of date.

## Change

`stopAgain()` also waits until the current frame is a different object from the one before the stop. A stop makes new frames, also for a frame whose id and function are the same. The tests that use a value of the earlier stop, `DAPJumpToDeclarationSessionTest` and `DAPJumpToValueSourceSessionTest`, don't use the current frame, so they don't have this race.

Only the test changes.

## Tests

`DAPSetExpressionSessionTest` passes headless on IC 2024.2, 2025.3 and IU 2026.3: 19 tests each, also in three runs on 2026.3.
@lagergren

Copy link
Copy Markdown
Collaborator Author

Combined, unchanged, with the other small fixes into #2219, one commit each, so that they take one review instead of six.

@lagergren lagergren closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server window doesn't look nice with larger font sizes Ui issue: When reducing the size of the LSP console, the title text gets clipped.

1 participant