microsoft / microsoft/language-server-protocol

offer more configuration for textDocument/hover

Open
#772 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request help wanted hover
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

Because the hover result is either a string or a markdown string, it's hard to offer users more configuration over their hover results.

A good example of this is this issue raised against gopls: https://github.com/golang/go/issues/32561. Some users want to see full documentation on hover, while others prefer to see one sentence of the documentation, while others may prefer to see none at all.

Personally, my preferred solution would be to offer users a "see more" option, something like holding down Command and hovering over an identifier. Right now, that just previews the declaration of the identifier, but perhaps it could be something like a detailed hover?

Is there any chance that the textDocument/hover could have a detailed configuration, or maybe there could be an additional textDocument/detailedHover? I would suspect that most languages return some combination of documentation and signatures/type declarations, so maybe hover could even be more structured than just a string?

Otherwise, I will likely add additional configurations to gopls to control the level of hover. I figured it was worth raising this issue because I suspect other languages would encounter these questions as well.

Contributor guide

No contributing guide indexed for this repository

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 with the textDocument/hover protocol entry point and review the linked gopls issue for the motivating use cases. The issue proposes several incompatible directions, including detailed configuration, a separate detailedHover method, and structured results; done would require an agreed protocol design rather than a localized edit.

Written by the indexing model from the issue text.

Assessment

Domain
api, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.