proposal: Improved hover formatting for monaco and vscode
See original GitHub issuegetHoverInformation
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:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top GitHub Comments
Ok, cool. I get it now. I will start working on it 😃
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