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

Broken playground example for hover provider in 0.11.1 #780

Closed
fredriklengstrand opened this issue Mar 19, 2018 · 5 comments
Closed

Broken playground example for hover provider in 0.11.1 #780

fredriklengstrand opened this issue Mar 19, 2018 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@fredriklengstrand
Copy link

fredriklengstrand commented Mar 19, 2018

monaco-editor version: 0.11.1
Browser: Safari, Chrome, Firefox, Edge
OS: Mac OS, Windows
Steps or JS usage snippet reproducing the issue:

Open the hover provider example in the playground and you'll notice two issues:

  1. The **SOURCE** markdown content is not shown since it now expects it to be { value: '**SOURCE**'} according to this code: https://github.com/Microsoft/monaco-editor/blob/32f54336573831e97bfd1ac07da625eb6c7133fd/monaco.d.ts#L4502-L4513
    https://github.com/Microsoft/monaco-editor/blob/32f54336573831e97bfd1ac07da625eb6c7133fd/monaco.d.ts#L370-L373

  2. It does not seem like it supports code blocks anymore (Unless I'm missing something) so the { language: 'html', value: res.responseText.substring(0, 200) } content just becomes unstyled markdown content rather than a code block with syntax highlighting like it did before.

@rcjsuen
Copy link
Contributor

rcjsuen commented Mar 20, 2018

I can reproduce this problem also.

After you fix the problem, the hover does render the content just fine. However, the first time the hover appears it will not be styled. Subsequent hovers will have the content styled with syntax highlighting colours as expected.

@tomcl
Copy link

tomcl commented Apr 7, 2018

A related comment: hover markdown works fine if enclosed as above: {value: 'markdown string'}. However links in markdown are not clickable (though they display as links):

{ value: '**SOURCE** [link](www.google.com)'}

Displays a non-clickable link in the hover. It would be very useful to have clickable links in hover so that line decorations for error could hover error descriptions with links to further info.

Am I doing something silly here? Perhaps there is some security setting I need to change?

@alexdima alexdima self-assigned this Apr 11, 2018
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Apr 11, 2018
@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 11, 2018

@alexandrudima Thanks for fixing the example. Can you reproduce the "double hover" problem I described in my comment? I can open a separate issue about it if desired.

@alexdima
Copy link
Member

Hmm, I wonder why that would be the case. It is possible if the hover uses a language which is not yet loaded, that the hover triggers the loading of the language, and then on subsequent hovers the language/tokenizer will be there to tokenize.

Yes, please open a separate issue.

@rcjsuen
Copy link
Contributor

rcjsuen commented Apr 11, 2018

Thanks for checking, @alexandrudima. I've opened #812 to track this.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants