Skip to content

Prettier Hover/MarkupContent "regions" #374

@sanbox-irl

Description

@sanbox-irl

Hello,

I hope this is clear here. I am creating the basics of a language server right now. I am not very well experienced in this, so this point might be moot and I may be missing something.

I am trying to make a Hover request similar to the Typescript hover requests built into VSCode. Although I can make markdown within my Hover, I can't make separate "regions" for my Hover request.

Let me demonstrate with pictures what I mean. Here's a nice looking Hover in VSC:

capture

Notice the way that my theme's colors define the two "regions". It's subtle, but very effective.

I'm trying to replicate that within my own Hover, but adding line breaks, header info, or any other method doesn't really pull off the same effect:

capture1

Although this isn't, obviously, bad, I think it's worse than the above image, since it's an extremely bold line, which doesn't even run the full length of its container.

I believe, based on some experimenting, that this is really just VSCode pooling two Hover requests together. However, I cannot send two Hovers (or at least, it does not appear that I can) through my Hover handler in an LSP.

If there is a known solution to this that I haven't been able to find, I would appreciate hearing about it. Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions