Skip to content

Two-part Hover info using MarkupContent #1456

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

Closed
michal-kapala opened this issue Mar 27, 2024 · 3 comments
Closed

Two-part Hover info using MarkupContent #1456

michal-kapala opened this issue Mar 27, 2024 · 3 comments

Comments

@michal-kapala
Copy link

Question

I'm aiming for a typical hover UI with colorized code element signature/type information and plain markdown docs at the bottom.

hover info

I managed to implement a demo using Hover.contents: MarkedString[]:

export function getHover(analysis: CodeAnalysis, params: HoverParams): Hover {
    return {
        contents: [
            {language: "jitterbit", value: '(function) WriteToOperationLog(string message): string'},
            'Some `text` over here'
        ],
    };
}

As MarkedString is deprecated, how can I achieve similar behaviour using MarkupContent?

Is it even possible given MarkupKind currently only supports markdown and plaintext? I think #843 tried to answer that.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 2, 2024

You can construct one string value that looks like this:

```jitterbit
(function) WriteToOperationLog(string message): string
```
Some `text` over here

@dbaeumer dbaeumer closed this as completed Apr 2, 2024
@dbaeumer
Copy link
Member

dbaeumer commented Apr 2, 2024

See also

* Here is an example how such a string can be constructed using JavaScript / TypeScript:

@michal-kapala
Copy link
Author

michal-kapala commented Apr 2, 2024

thanks, i tried that but it didnt work the first time probably because of the missing endlines, i guess a skill issue on my part

michal-kapala added a commit to michal-kapala/vscode-jitterbit that referenced this issue Apr 2, 2024
+ deprecated MarkupString subbed with MarkupContent (see microsoft/vscode-languageserver-node#1456)
+ version bumps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants