Skip to content

fix: give LSP Reference(s) no shortcut of its own, as Ctrl+Alt+H is Call Hierarchy - #2045

Merged
lagergren merged 2 commits into
redhat-developer:mainfrom
lagergren:fix/lsp-references-shortcut-takes-call-hierarchy
Nov 20, 2026
Merged

lagergren merged 2 commits into
redhat-developer:mainfrom
lagergren:fix/lsp-references-shortcut-takes-call-hierarchy

Conversation

@lagergren

@lagergren lagergren commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #801.

LSP Reference(s) had Ctrl+Alt+H in the default keymap, the shortcut
of IntelliJ's Call Hierarchy, which LSP4IJ supports and whose docs say to
press Ctrl+Alt+H. So with a language server that has call hierarchy,
the shortcut no longer found the references. The action keeps its menus,
Navigate / LSP Reference(s) and Go To / LSP Reference(s), and gets
no shortcut: one can be assigned in Settings / Keymap, and Find Usages
(Alt+F7) shows the references too. The docs of the references say so.

Not changed here, for a decision: three more actions of LSP4IJ share their
shortcut with an action of IntelliJ in the default keymap, which uses it in
a view of its own. Ctrl+Alt+Z of LSP Declaration(s) is also Rollback
Lines, and the revert and reset of the Changes view and of Git staging;
Ctrl+Alt+E of LSP Type Definition(s) is also Toggle Find in Selection
in the Find bar, the history of a console, and Perforce's Edit; and in
IntelliJ IDEA 2026.3, Ctrl+Alt+G of LSP Implementation(s) is also the
SQL Generator of the Database view.

Test: LSPActionShortcutsTest checks that no action of LSP4IJ takes the
shortcut of a navigation action of IntelliJ in the default keymap, as
Call Hierarchy, Find Usages or Go to Declaration. Without the change, it
fails with LSP Reference(s) and Call Hierarchy. It passes on 2024.2 and
on IntelliJ IDEA 2026.3.

…all Hierarchy

Fixes redhat-developer#801.

*LSP Reference(s)* had `Ctrl+Alt+H` in the default keymap, the shortcut
of IntelliJ's Call Hierarchy, which LSP4IJ supports and whose docs say to
press `Ctrl+Alt+H`. So with a language server that has call hierarchy,
the shortcut no longer found the references. The action keeps its menus,
`Navigate / LSP Reference(s)` and `Go To / LSP Reference(s)`, and gets
no shortcut: one can be assigned in `Settings / Keymap`, and Find Usages
(`Alt+F7`) shows the references too. The docs of the references say so.

Not changed here, for a decision: two more actions of LSP4IJ share their
shortcut with an action of IntelliJ in the default keymap. `Ctrl+Alt+Z`
of *LSP Declaration* is also Rollback Lines, and the revert and reset of
the Changes view and of Git staging; `Ctrl+Alt+E` of *LSP Type
Definition* is also Toggle Find in Selection in the Find bar, the history
of a console, and Perforce's Edit.

Test: `LSPActionShortcutsTest` checks that no action of LSP4IJ takes a
shortcut of another action in the default keymap, apart from those two.
Without the change, it fails with *LSP Reference(s)* and Call Hierarchy.
@lagergren lagergren added this to the 0.30.2 milestone Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes

    • Removed the default Ctrl+Alt+H shortcut from “LSP Reference(s)” to avoid conflict with Call Hierarchy.
  • Documentation

    • Clarified that references can be found with Find Usages (Alt+F7) and that users can assign a shortcut in Settings / Keymap.

The References action no longer has a default shortcut. A keymap test checks for conflicts with actions outside LSP4IJ. The documentation describes how to assign a shortcut and use Find Usages to show references.

Changes: References shortcut

Layer / File(s) Summary
Shortcut registration and validation
src/main/resources/META-INF/plugin.xml, src/test/java/com/redhat/devtools/lsp4ij/features/references/LSPActionShortcutsTest.java, docs/LSPSupport.md
The action no longer registers Ctrl+Alt+H. The test checks LSP4IJ action shortcuts against actions outside the plugin, with two named exemptions. The documentation explains the Call Hierarchy conflict, shortcut assignment, and use of Find Usages (Alt+F7).

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 5145b

This change removes the default Ctrl+Alt+H shortcut from LSP Reference(s) so it no longer conflicts with Call Hierarchy. Users can assign their own shortcut or use Find Usages. It carries little merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: LSP Reference(s) no longer takes Ctrl+Alt+H because that shortcut belongs to IntelliJ's Call Hierarchy. The raw summary confirms the plugin.xml shortcut removal, the …
Linked Issues check Passed [#801] The issue reports that the Call Hierarchy shortcut Ctrl+Alt+H overrides the Find References shortcut, so references work only from the menu. The PR removes the default Ctrl+Alt+H shortcut from …
Out of Scope Changes check Passed All changes connect to #801. plugin.xml removes the conflicting shortcut. docs/LSPSupport.md documents the new behavior. LSPActionShortcutsTest verifies that the conflict is gone and guards against si…
Description check Passed The description states that the PR fixes #801 by removing the Ctrl+Alt+H default shortcut from LSP Reference(s), which conflicts with IntelliJ's Call Hierarchy. It names the affected menus, the docs u…
Full details: Title check

Explanation

The title states the main change: LSP Reference(s) no longer takes Ctrl+Alt+H because that shortcut belongs to IntelliJ's Call Hierarchy. The raw summary confirms the plugin.xml shortcut removal, the docs update, and the new keymap conflict test, so the title matches the changeset.

Full details: Linked Issues check

Explanation

[#801] The issue reports that the Call Hierarchy shortcut Ctrl+Alt+H overrides the Find References shortcut, so references work only from the menu. The PR removes the default Ctrl+Alt+H shortcut from LSP.GotoReference in src/main/resources/META-INF/plugin.xml (+0/-1). Ctrl+Alt+H is no longer claimed by LSP4IJ, so Call Hierarchy keeps it. The menu entries Navigate / LSP Reference(s) and Go To / LSP Reference(s) remain. docs/LSPSupport.md (+3 lines) documents the absence of a default shortcut, the option to assign one in Settings / Keymap, and Find Usages (Alt+F7) as an alternative. LSPActionShortcutsTest (+58 lines) adds a regression check that fails without this change for LSP Reference(s) and Call Hierarchy. The issue does not require a new default shortcut for Find References. The reviewed evidence is the PR summary and the change summaries. The diff hunks were not read directly. Whether the absence of a default shortcut meets the author's intent for the issue is a product decision the issue does not settle.

Full details: Out of Scope Changes check

Explanation

All changes connect to #801. plugin.xml removes the conflicting shortcut. docs/LSPSupport.md documents the new behavior. LSPActionShortcutsTest verifies that the conflict is gone and guards against similar conflicts. The test deliberately skips LSP Declaration(s) (Ctrl+Alt+Z) and LSP Type Definition(s) (Ctrl+Alt+E). The PR description states that these two conflicts are left for a separate decision, so the PR does not change them. The test does not add unrelated behavior. The change summaries show no unrelated code changes.

Full details: Description check

Explanation

The description states that the PR fixes #801 by removing the Ctrl+Alt+H default shortcut from LSP Reference(s), which conflicts with IntelliJ's Call Hierarchy. It names the affected menus, the docs update, the new LSPActionShortcutsTest test, and the two other shortcut conflicts left for a decision. It matches the changeset and the objectives.

Recent review info

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: 0a12e311-0f3e-4d5b-9df4-68dea44a873b
Commits

Reviewing files that changed from the base of the PR and between 0af1afc and 5145bde.

Files selected for processing: 3

  • docs/LSPSupport.md
  • src/main/resources/META-INF/plugin.xml
  • src/test/java/com/redhat/devtools/lsp4ij/features/references/LSPActionShortcutsTest.java
Files with no reviewable changes: 1

  • src/main/resources/META-INF/plugin.xml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.42%. Comparing base (0af1afc) to head (15aa3c8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2045      +/-   ##
==========================================
- Coverage   49.44%   49.42%   -0.03%     
==========================================
  Files         813      813              
  Lines       33324    33324              
  Branches     5191     6848    +1657     
==========================================
- Hits        16478    16470       -8     
- Misses      14272    14279       +7     
- Partials     2574     2575       +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

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

… IntelliJ only

The check against every action of the default keymap failed on IntelliJ
IDEA 2026.3, where Ctrl+Alt+G of LSP Implementation(s) is also the SQL
Generator of the Database view. Such actions use the same keys in views of
their own, and depend on the product and its plugins. The test now checks
the navigation actions of IntelliJ that LSP4IJ supports for language
servers too, as Call Hierarchy, and still fails without the fix of redhat-developer#801.
@lagergren
lagergren merged commit 8328f72 into redhat-developer:main Nov 20, 2026
13 of 15 checks passed
@lagergren lagergren added the bug Something isn't working label Nov 23, 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.

Find references shortcut lost when callHierarchy is enabled

1 participant