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

First hover is no longer syntax-highlighted since 1.25 #53723

Closed
Gama11 opened this issue Jul 6, 2018 · 8 comments · Fixed by #58703
Closed

First hover is no longer syntax-highlighted since 1.25 #53723

Gama11 opened this issue Jul 6, 2018 · 8 comments · Fixed by #58703
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@Gama11
Copy link
Contributor

Gama11 commented Jul 6, 2018

  • VSCode Version: 1.25.0
  • OS Version: Windows 10

We noticed a regression in the Haxe extension where the first time a hover hint is shown after VSCode is loaded, it's missing syntax highlighting. For subsequent hovers after that it works fine.

This didn't happen in 1.24:


I think this might be related to using a different grammar / language ID than the text document itself in hover hints (as it seems fine in TS for instance). We have some special language IDs for hover to get it to use a specific scope of the Haxe grammar (haxe.type and haxe.argument instead of haxe):

This issue also affects the vscode-reasonml extension, which does the same thing:

@aeschli
Copy link
Contributor

aeschli commented Jul 10, 2018

Reproduces and debugged. The markdownRenderer (used by the hover for the code block) accesses the TokenizationRegistry at a time when the grammar is still loaded.

  • the TokenizationRegistry has a synchronous get
  • new ITokenizationSupport's are registered to the TokenizationRegistry after a mode are created

Looks like there has been a timing change due to the change to load the grammar files asynchronously.

@aeschli aeschli assigned jrieken and unassigned aeschli Jul 10, 2018
@jrieken jrieken removed their assignment Jul 10, 2018
@jrieken
Copy link
Member

jrieken commented Jul 10, 2018

Looks like @aeschli removed support for this and we don't support this any longer. Closing as out-of-scope.

@jrieken jrieken added the *out-of-scope Posted issue is not in scope of VS Code label Jul 10, 2018
@vscodebot
Copy link

vscodebot bot commented Jul 10, 2018

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Jul 10, 2018
@Gama11
Copy link
Contributor Author

Gama11 commented Jul 10, 2018

To clarify, what exactly is it that's not supported anymore? Syntax highlighting in hover hints that uses language IDs different from the document language itself?

Note that this isn't limited to the Haxe and OCaml extensions, there are even instances of this in vscode.d.ts itself. There are a number of doc comments there with javascript / js / json code blocks that are now only highlighted the second time you hover over them (and the respective grammar hasn't been loaded yet at that point by e.g. opening a JS file):

(there also appears to be a separate issue with leading * characters in code blocks not being removed)

@jrieken
Copy link
Member

jrieken commented Jul 10, 2018

Syntax highlighting in hover hints that uses language IDs different from the document language itself?

No, we still support that. The issue is about loading a new language via the hover for the first time. Getting tokenisation for a language used to be coupled with loading it (there is something called getOrCreateMode) and once that resolved we would have tokenisation support. With some recent refactorings tokenisation got decoupled from loading a language and this "trick" doesn't work anymore. So, this is just about the first time and the hover.

@Gama11
Copy link
Contributor Author

Gama11 commented Jul 10, 2018

I see... Is there any workaround, perhaps something that would trigger loading the language grammar in an extension's activate() method? If the Haxe extension is activated, I think it's fair to say it will pretty much always need these hover language IDs sooner or later since hover is used so commonly.

@aeschli aeschli self-assigned this Jul 11, 2018
@aeschli aeschli reopened this Jul 11, 2018
@aeschli
Copy link
Contributor

aeschli commented Jul 11, 2018

I'll see what I can do to fix this.

@gingerbeardman
Copy link

@aeschli thank you

@aeschli aeschli added bug Issue identified by VS Code Team member as probable bug and removed *out-of-scope Posted issue is not in scope of VS Code labels Sep 14, 2018
@aeschli aeschli added this to the September 2018 milestone Sep 14, 2018
@mjbvz mjbvz added the verified Verification succeeded label Sep 27, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 1, 2018
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 verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants