redhat-developer / redhat-developer/lsp4ij

Organize hover responses in a predictable way for ease of use

Open
#390 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement hover
Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

I have a file called microprofile-config.properties and it contains

injected.value2=Injected value2
value=lookup value

com.example.demo.client.Service/mp-rest/url=http://localhost:9081/data/client/service
serviceb.url=http://localhost:9081/data/protected

When I hover over the word "Service" I can get two different results in the IDE. Two different language servers respond and it seems random which result is displayed first. Sometimes an empty page is displayed as page 1 and other content on page 2.
image
image
Sometimes the page with all the content is first and the blank one is second.
image

I think the responses should be sorted in some deterministic way so the user can rely on seeing things a certain way. Even if it is as simple as alphabetical order by name of language server it should be consistent over a reasonable period of time. Obviously as language servers start and stop the order could change but it should be consistent while a certain collection of LS are running.

Also, one language server responded with

[Trace - 16:48:07] Received response 'textDocument/hover - (9)' in 6ms.
Result: {
  "contents": {
    "kind": "plaintext",
    "value": ""
  }
}

Fixed I think we should check value for null or empty string and not even return a message in that case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the LSP client's handling of multiple textDocument/hover responses, using the examples in this issue to reproduce the inconsistent ordering. Done means hover results are presented in a deterministic order while the active language-server set remains unchanged, with the reported empty response behavior considered alongside the ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.