Closed Fallensouls closed 5 years ago
Hello @Fallensouls , Is Go extension installed in your VSCode? Without this extension VSCode doesn't recognize .go files (they are treated as plaintext) and initialization of {Syntax Highlighter} isn't triggered.
@EvgeniyPeshkov Yeah, I am sure the go extension is installed and I use gopls. Actually, the highlighter seems not work when I open .py files, either. (I have also installed the python extension to test it)
If I change editor.tokenColorCustomizations
, there is something different but obviously not I want.
Do you have any idea about this? Thx : )
Hmmm... This is really strange. It's the first time extension doesn't work at all.
Could you please check syntax.highlightLanguages
in your settings.json
? Just in case. This is the only setting that can disable Syntax Highlighter.
Also, could you kindly say your OS?
I check it and it is default value. I don't know why workbench.colorCustomizations
can't change color but editor.tokenColorCustomizations
can, they are using the same analysis tool, right?
I am working on Windows x64.
workbench.colorCustomizations
allows to customize UI colors, while editor.tokenColorCustomizations
defines colors of syntax tokens.
I've embedded color settings of Syntax Highlighter into workbench.colorCustomizations
simply because VSCode extension API do not provide access to token colors.
It is strange question, but maybe you have VSCode installed on D:\ drive, or your user folder is not on C:\ drive?
@EvgeniyPeshkov Yeah, actually I have VSCode installed on D:\ drive. When I reinstall it on C:\ drive, the highlighter works correctly. Could you please tell me the reason? Thank you very much!
The reason has a long story (=.
The main cause is this line in tree-sitter-web
implementation. Basically, it checks that provided path is absolute, but in a strange way. It assumes that no protocol must be specified. On Windows though absolute paths have form C:/Users/...
, so C
is treated as protocol and everything goes wrong. So for Windows I made workaround removing drive letter and using paths of form /Users/...
when loading parser's wasm. By default such path points to file on C:\ drive. This fix is so ugly, that I haven't even pushed it to the repo. So this worked in general, not many people install VSCode on secondary drives.
Fortunately, the bug is already fixed in this commit. So today I'll publish the new version that will work when VSCode is installed on any drive (=. Thank you very much for discovering this issue.
Thanks for your explanation. Since the new version has fixed the bug, I think we can close the issue.
Hello! I tried to use this extension to highlight my![QQ图片20190805130149](https://user-images.githubusercontent.com/40592337/62440118-3aff8800-b781-11e9-934c-c19c319a1189.png)
Go
files on latest VSCode but it didn't work. I followed the guide and setworkbench.colorCustomizations
, there was nothing changed.I have no idea what's wrong, any advice?