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

Remote Development breaks Semantic Coloring #3942

Closed
ablackle opened this issue Jul 18, 2019 · 24 comments
Closed

Remote Development breaks Semantic Coloring #3942

ablackle opened this issue Jul 18, 2019 · 24 comments
Assignees
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@ablackle
Copy link

ablackle commented Jul 18, 2019

Using VSC's Remote Development extension pack.
Using RHEL 7 as a server, and Windows 10 as a client.
C/C++ 0.24.0 installed on the server.

Semantic coloring is missing instances. This does not occur in my local Windows VSC, local Windows VSC Insiders, or remote RHEL VSC (via VNC).

This is the expected result.
local_sem_coloring

This is the image with the missing coloring.
client_sem_coloring

@ablackle
Copy link
Author

Updated because I can't proof read.

@Colengms
Copy link
Collaborator

Hi @ablackle . Thanks for reporting this. This is currently a limitation, as there is not an API to access color settings in themes ( microsoft/vscode#32813 ). We parse the current theme file directly to look up colors. When remoting, cpptools is running on the remote machine, but the themes are on the local machine, so cpptools is unable to access them. Colors overridden in user settings are applied, however. We are working with the core VS Code team on better facilitating semantic colorization, and will revisit this as soon as we can.

@joelspadin
Copy link

Do you have any examples for how to override colors in user settings? It would be nice if I could just copy colors from my theme into settings until this gets properly fixed.

I tried setting several of the scopes listed on https://code.visualstudio.com/docs/cpp/colorization-cpp in my remote machine's settings.json, but nothing changed. What I tried:

    "editor.tokenColorCustomizations": {
        "textMateRules": [
            {
                "scope": [
                    "variable.other.local",
                    "variable.other.global",
                    "variable.parameter",
                    "variable.other.property.cli"
                ],
                "settings": {
                    "foreground": "#FF0000"
                }
            }
        ]
    }

@Colengms
Copy link
Collaborator

Hi @ChaosinaCan . Thanks for reporting this. It looks like the failure to find the theme files may be causing semantic colorization to abort instead of proceed with what settings are available. I will investigate.

Also, there are a number of scopes not included in the documentation (as they were existing scopes, not newly added), which would also need to be added in settings, as we are also reading those from theme files. We'll need to publish a full list to enable working around the issue using settings.

If you haven't already, please upvote this issue: microsoft/vscode#32813 :)

@Colengms Colengms self-assigned this Oct 10, 2019
@joelspadin
Copy link

Already upvoted. Thanks!

@drldavis
Copy link

I'm having the same problem when using Windows Subsystem for Linux. Anyone find any solutions?

@jheaff1
Copy link

jheaff1 commented Jan 14, 2020

I too would very much like to have this issue resolved. Until the enhanced colorization is functional via remote development, I will continue to use the clunky Eclipse C++ editor

@shyney7
Copy link

shyney7 commented May 29, 2020

I'm using WSL2 to develop for Linux and have also problems with the C++ syntax highlighting with my installed theme (Dracula). Is this the same problem as described here? Here are some pictures:

local_sem_coloring
WSL2 (left) Win10 (right)

I dont want to open a new issue if this is caused by the same problem.

Also the issue: microsoft/vscode#32813 that seems to be the solution to this is from 2017. Is it still planned as a milestone? I was really looking forward to using WSL2 with the new Windows Update and not relying on virtual machines anymore.

@sean-mcmanus
Copy link
Collaborator

@shyney7 Yes, your issue is the same as this. It may get fixed after #4992 is finished.

@KentoNishi
Copy link

@sean-mcmanus Do you have any information about when users can expect #4992 to be shipped?

@sean-mcmanus
Copy link
Collaborator

@KentoNishi It got delayed because we needed VS Code to update some themes. It should get into 0.29.0 in July (maybe earlier in a C/C++ 0.29.0-insiders release if VS Code Insiders has the updated themes).

@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Jul 1, 2020
@Colengms Colengms modified the milestones: Tracking, 0.29.0 Jul 1, 2020
@Colengms
Copy link
Collaborator

Colengms commented Jul 1, 2020

Considering this fixed with #4992 . If this scenario still occurs, it would be an issue with VS Code's semantic highlighting support.

@cSchubes
Copy link

cSchubes commented Jul 2, 2020

when is 0.29.0 supposed to ship? I tried the insiders update to no avail. Looking forward to having the enhanced colors soon!

@sean-mcmanus
Copy link
Collaborator

@cSchubes Next week (0.29.0-insiders2).

@bobbrow
Copy link
Member

bobbrow commented Jul 3, 2020

Please also note that you will need to use the VS Code Insiders build to make this work until the June 2020 release ships (which should also be very soon). The VS Code changes that support this are in 1.47.

@sean-mcmanus
Copy link
Collaborator

Remote colorization is available with https://github.com/microsoft/vscode-cpptools/releases/tag/0.29.0-insiders2 , but I believe you would also need VS Code version 1.47 as well (which is still in Insiders) . Let us know if you hit any issues with it.

@Colengms
Copy link
Collaborator

Colengms commented Jul 9, 2020

Prior to VS Code 1.47, using a Color Theme that does not opt in for semantic highlighting will cause semantic highlighting to be disabled, regardless of the value of the editor.semanticHighlighting.enabled setting.

However, the following setting appears to work around that:

    "editor.semanticTokenColorCustomizations": {
        "enabled": true
    }

If using a theme that opts in for semantic highlighting (such as all built-in VS Code themes), I believe those should work fine.

@cSchubes
Copy link

cSchubes commented Jul 9, 2020

@sean-mcmanus @Colengms can confirm this works with 0.29.0-insiders2 and VS Code 1.47 Insiders. Amazing stuff! So happy to have my fancy colors back!!

@jheaff1
Copy link

jheaff1 commented Jul 9, 2020

After updating to 0.29.0-insiders2, I too can confirm that enhanced colourisation works. However, the colours i have defined in my settings.json, like in the comment below, are no longer applied to the code. How do i customise semantic coloring now?

#3942 (comment)

@Colengms
Copy link
Collaborator

Colengms commented Jul 9, 2020

Hi @jheaff1 . To confirm, are you using either VS Code >=1.47 (currently VS Code insiders) or have specified the following?

    "editor.semanticTokenColorCustomizations": {
        "enabled": true
    }

If you've done either of these things and are not getting the colors you expect, could you open a new issue and indicate which theme and related settings you are using?

@Colengms
Copy link
Collaborator

Colengms commented Jul 9, 2020

I am seeing an issue where after enabling/disabling semantic highlighting, you may have reload the window or edit the file in order to cause VS Code to issue a fresh request for semantic tokens.

@sean-mcmanus
Copy link
Collaborator

@Colengms We could show the Reload dialog like we do in some other cases.

@jheaff1
Copy link

jheaff1 commented Jul 10, 2020

@Colengms adding "semanticTokenColorCustomizations" to my settings.json made it all work, thank you!

@sean-mcmanus
Copy link
Collaborator

Semantic colorization works with remote development with 0.29.0.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

10 participants