question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

proposal: Improved hover formatting for monaco and vscode

See original GitHub issue

getHoverInformation in graphql-language-service-interface could give us more than it does now, which is two very nicely generated strings. ours generates a static text string, but most implementations add special markdown to provide a nicer look and feel for both vscode extensions and our monaco mode’s hover items.

both vscode hover provider and monaco hover provider expect arrays of markdown strings. we are in great luck!

the necessary markdown is actually quite limited, because it’s just a matter of adding block formatting to the top line and a few other tricks. here’s how typescript does it: https://github.com/microsoft/monaco-typescript/blob/master/src/languageFeatures.ts#L425

if you introduce this capability to the getHoverInformation function, you’ll be able to test it in both the monaco example, by testing with the vscode-graphql extension, etc.

this is a good “getting started” issue if you are looking to learn how to work with the monaco mode, vscode extensions, and/or the monaco branch for GraphiQL itself.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
harshithpabbaticommented, May 13, 2020

@harshithpabbati when you hover over code in your editor, our output is very plain, whereas hover dialogs for other languages using monaco or vscode are much nicer.

as it turns out, thats just a matter of adding some markdown to strings that are currently dynamically generated in plaintext. so, to accomplish this goal, the only changes you would make would be to getHoverInformation

Ok, cool. I get it now. I will start working on it 😃

1reaction
acaocommented, May 14, 2020

we just need to add similar markdown to the generated string. getHoverInformation is a function that generates a string, and currently its in plaintext, and now we need to use markdown. See the linked example for more information

Read more comments on GitHub >

github_iconTop Results From Across the Web

May 2022 (version 1.68) - Visual Studio Code
Holding Alt while a hover is active will now "lock" it, giving it a wider ... Because of this, improvements were made around...
Read more >
Language Server Extension Guide - Visual Studio Code
Hover : provides hover information for a symbol selected in a text document. Signature Help: provides signature help for a symbol selected in...
Read more >
October 2021 (version 1.62) - Visual Studio Code
above to false , hovers will render below the current line. IntelliSense hover below the current line in the editor. Unicode directional formatting...
Read more >
Visual Studio Code June 2022
Hovering over the indicator reveals a hover that shows language overrides, when applicable. The video later shows the new default override ...
Read more >
Programmatic Language Features - Visual Studio Code
After this extension gets activated, whenever you hover over some JavaScript code, VS Code queries all HoverProvider for JavaScript and shows the result...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found