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

[C++] Incorrect text syntax color on generated image #13

Closed
AndhikaWB opened this issue Oct 20, 2019 · 12 comments
Closed

[C++] Incorrect text syntax color on generated image #13

AndhikaWB opened this issue Oct 20, 2019 · 12 comments
Labels
bug Something isn't working can't fix 😭 help wanted Extra attention is needed

Comments

@AndhikaWB
Copy link

AndhikaWB commented Oct 20, 2019

VS Code v1.39.2
CodeSnap v1.0.15

aaaa

As you can see, only variable angka is colored as light blue. Other variables such as kol, bar, baris, kolom, etc. are colored as white on the generated image. cout and cin are also colored as white.

Original code: https://pastebin.com/tuLaWuEP

Simple C++ code (without 2D array) works fine, no color issue so far.

@kufii kufii added the bug Something isn't working label Oct 21, 2019
@kufii
Copy link
Owner

kufii commented Oct 21, 2019

Thanks for the report,

What theme are you using? is this the default c++ language definition?

I thought it was default theme, but when I select the default theme, the colors match your generated image even in my editor.

@AndhikaWB
Copy link
Author

AndhikaWB commented Oct 21, 2019

I'm using the default dark theme on Windows 10. Yes, I didn't use any custom definition (I don't even know how to declare it yet). I also installed Polacode after this weird bug, seems to be affected as well. Did you try using my code?

After trying today, simple codes are now affected by this bug as well:
Screenshot_2

My settings.json file doesn't even have any modification related to theme: https://pastebin.com/DKeKVzhr

I'm using MinGW C++ compiler with C/C++ extensions installed if that helps, I will try cleaning my extensions folder or even deleting the entire data folder to see if the bug still exist.

@AndhikaWB
Copy link
Author

Issue still persist even after resetting my VS Code data (I deleted the user-data folder and extensions\adpyke.codesnap-1.0.15 folder manually).

My list of installed extensions:
Screenshot_3

@kufii
Copy link
Owner

kufii commented Oct 21, 2019

What's interesting is that when using the default vs code settings my token colors are slightly different. Even when using your cpp file. Variables are white not blue like yours, and look the same in CodeSnap. I'll investigate further when I have some free time

@AndhikaWB
Copy link
Author

Maybe you don't have any C++ compiler installed or don't have C/C++ extensions installed?

@kufii
Copy link
Owner

kufii commented Oct 21, 2019

What OS are you on? Looks like Windows 10 but just want to be sure

@kufii
Copy link
Owner

kufii commented Oct 21, 2019

I don't have the c++ compiler but I do have the extensions. I'll install the compiler when I'm at my pc later

@AndhikaWB
Copy link
Author

Yes, Windows 10 but LTSC edition. Doesn't make any difference to Windows 10 Pro/Home in this case.

@AndhikaWB
Copy link
Author

AndhikaWB commented Oct 22, 2019

In case you don't want to install C++ compiler (because you don't need it anyway), you can just use Nuwen's MinGW distro.

Extract it somewhere like C:\MinGW. Open Command Prompt, type set "PATH=%PATH%;C:\MinGW\bin" (where gcc.exe exist) and then type YourVSCodePath\Code.exe to run VS Code.

MinGW will now be recognized by VS Code without the need of installing it. Just delete C:\MinGW later. You may still need to configure the C/C++ extensions, though.

@kufii
Copy link
Owner

kufii commented Oct 22, 2019

I'm now successfully reproducing the issue.

The colors are being changed by C_Cpp.enhancedColorization. Unfortunately I have not yet found a way to get colors set by extensions, only ones set by themes.

@kufii kufii added the help wanted Extra attention is needed label Oct 22, 2019
@AndhikaWB
Copy link
Author

I'm fine with it actually, no need to push yourself. I'll try to make a request (or search for the same issue) on Polacode repo and see if it can get fixed, or maybe on VS Code repo itself.

@amir1376irani
Copy link

I'm using an extension named Better Comments which install counts are about a million user.
it makes comments colorful. For example if you type //! my comment as a new comment line, it gets red.
Unfortunately CodeSnap shows all of those comments in default green color, not what is really shown on screen.

Better Comments link for vs-code : https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't fix 😭 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants