Monokai / monokai-pro-vscode

Issue tracking for Monokai Pro for Visual Studio Code
321 stars 8 forks source link

Monokai Pro in c++ code did not render colors right in code editor, but correct in hover #385

Closed DvdBr3o closed 2 weeks ago

DvdBr3o commented 8 months ago

image

This is a piece of c++ code.

The color of std::wstring should have been rendered as white for std, blue for wstring.

However, it was rendered green for std, white for wstring.

The correct render result should have been the one presented in the hover.

I'm not sure whether this is something to do with monokai pro, since I've tried other themes as well, some of which performs right while some don't.

This is only one instance, something like blue for macros being rendered as white could also be seen below:

image

GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE, GLFW_DECORATED in this case.

The LSP is clangd.

I could quite assure that when i prevoiusly use monokai pro, they performed correctly. While somehow they don't now. :(

Jas0nG commented 2 months ago

I encountered a similar problem when I switched my LSP from the VS Code C/C++ to clangd.

image

The class name Widget wasn't highlight properly .

I checked token by Scope inspector : Developer: Inspect Editor Tokens and Scopes.

image

It revealed that the class name 'Widget' and the object 'widget' were both mistakenly classified as 'source' and lacked semantic tokens, which is why they appeared in white. However, the hover feature correctly identifies the type of 'Widget', indicating that clangd's semantic tokenization is functioning correctly, but the semantic highlighting is not.

Reference to Enablement of semantic highlighting, I adjusted editor.semanticHighlighting.enabled from configuredByTheme to true, This resolved the issue, and now the semantic tokens are displayed correctly as well ^_^

image

Hope this may help ^_^

DvdBr3o commented 2 weeks ago

@Jas0nG it works! :)