Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple hover targets under the cursor #1920

Open
akaralar opened this issue Apr 15, 2024 · 1 comment
Open

Support for multiple hover targets under the cursor #1920

akaralar opened this issue Apr 15, 2024 · 1 comment
Labels
feature-request Request for new features or functionality hover
Milestone

Comments

@akaralar
Copy link

akaralar commented Apr 15, 2024

In Swift, a type can also be used as as an initializer (constructor) and the hover for Xcode returns both the type documentation and the documentation for the initializer.

let _ = URL(string: "http://example.com")
         ^
       request hover from cursor here

How these appear in Xcode are shown below.

Type hover doc

image

Initializer hover doc

image

Would it make sense for LSP to also support an array of Hover items as a response to the Hover request?

Also in the screenshots I shared, once the hover is presented, it's possible to switch between declarations shown at the top, so the top part acts somewhat like a "table of contents" of sorts for the resolved declarations. If multiple hover items are to be supported, it would be useful to have a field in Hover response for the resolved declaration, possibly of type MarkedString or MarkupContent.

@michaelpj
Copy link
Contributor

This would be useful for HLS. We have multiple different pieces of information that we provide in hovers, and at the moment we just concatenate them all together with some headers. It's not terrible, but a more structured approach would be nice.

@dbaeumer dbaeumer added feature-request Request for new features or functionality hover labels May 6, 2024
@dbaeumer dbaeumer added this to the Backlog milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality hover
Projects
None yet
Development

No branches or pull requests

3 participants