Reputation: 1069
I am doing remote development on a Linux machine using VSCode Remote-SSH. I have installed the C/C++ extension on the remote machine via VSCode. Most code does get syntax highlighting correct but I noticed some issues.
C structures are not colored at all.
Funny thing is the colors work when I ctrl+click to go to the structure.
This is really bothering me. Why do these structures not get colored like they do when I do local development on my windows machine?
Here is my c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}",
"${workspaceFolder}/../../dwcore/dwcore",
"${workspaceFolder}/../../dwcore/ilsutil",
"${workspaceFolder}/../../dwcore/ilslog"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"compilerArgs": [],
"browse": {
"path": [
"${workspaceFolder}/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
Upvotes: 4
Views: 2667
Reputation: 87
This was fixed since cpptools version 0.29.0
You can see it in the changelog here: https://github.com/microsoft/vscode-cpptools/releases/tag/0.29.0
There its written:
Switch to using the VS Code Semantic Tokens API for semantic colorization (works with remoting). PR #5401, #3932, #3933, #3942
Update your extension and it should work now without problems
Upvotes: 1
Reputation: 36
Unfortunately, enhanced colorization does not seem to be supported with remote development at the moment according to a discussion on the following issue: https://github.com/microsoft/vscode-cpptools/issues/4569
Enhanced colorization does not currently work via remoting, as we don't have access to the current Theme's files to look up colors.
This means that usual syntax highlighting based on grammar will work, as in typedef struct mystruct
where the function of all token can be determined based only on the surrounding context, but advanced highlighting that requires more knowledge that needs to be provided by intellisense will not.
Note that intellisense overall work with remote development and ctrl+click will show you the corresponding definition, which is correctly colored based on grammar.
Upvotes: 2