Skip to content

Find Usages: merge the language server's usages with those of the language plugin #2227

Done

Description

@lagergren

In #729 the reporter (Scala plugin + Metals) also asked: "I would also prefer that search result from both LSP and language plugin to be also merged". The first request was fixed in #2219 (3e24de8): the declaration was listed under Definitions, Type Definitions and References.

What happens

When Find Usages searches a language plugin's element, IntelliJ runs both the plugin's own search and LSP4IJ's CustomUsageSearcher (FindUsagesManager.createUsageSearcher). The usage view merges a line's usages only within one group (GroupNode.tryMerge), and it groups by usage type and by file structure. LSP4IJ's usages have their own usage type ("References") and no file-structure parent. So a reference that both find is listed twice, for example under "Method call" and under "References".

Not covered by a fix in LSP4IJ alone

  • When LSP4IJ's own target wins ("LSP Symbol", as in option "merge search results from the same line" is not effective on Scala + metaLS #729's screenshot), the plugin's search doesn't run at all, so there is nothing to merge with.
  • References whose range differs from the plugin's (such as Scala backticks), or that are in a non-base language tree, can't be matched exactly.
  • Definitions, type definitions and implementations are separate LSP requests, without a plugin reference to match.

Activity

  1. added this to the 0.30.2 milestone on Nov 25, 2026
  2. added
    enhancement
    on Nov 25, 2026
  3. added a commit that references this issue on Nov 25, 2026
    30033b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions