-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Theia is producing unexpected semantic highlightings for c++. #5854
Comments
I checked and the arguments being passed by the semantic highlighting service to It's possible we're running into this bug / limitation in the |
In #5941, I have implemented a proposed workaround for microsoft/monaco-editor#1070 in Theia. I'm not sure if it's the right approach, and even if it is the patch isn't complete, but it does fix this issue as well, confirming that it's the same underlying cause. |
Closed via #5941. |
I'm also working on adding custom semantic highlight on Monaco Editor. How did Theia add colors to the minimap? |
I think it's not supported. From here:
|
Yes, I see Theia is using |
Description
Theia's semantic highlighting client is producing unexpected colorings in certain cases after enabling it for the c++ client. (look at this PR here for a reference on how to do it.
I've verified that clangd sends the correct source ranges for the test cases below.
Reproduction Steps
In this case theia will color the
aaa::foo();
incorrectly. The entireaaa::foo
range will be highlighted as a function. Clangd sends theaaa
range as a namespace and thefoo
range as a function.On thing I tested was to add a custom rule to the color theme for namespaces (I gave namespaces a gray color). When doing that the
aaa
part will be highlighted as a namespace (which is correct). But the::foo
will be highlighted as a function. So in this case it almost seems to work correctly, but the::
should not be highlighted as a function.Another case (probably related to the one above though) is this one.
Here without the custom namespace rule the entire
aaa::A::f
range is highlighted as a function. When adding the custom namespace ruleaaa
is highlighted as a namespace, but the::A::f
range is highlighted as a function.However, the
aaa::A a
line is highlighted correctly. The::
is not highlighted here.aaa
is a namespace,A
is a class anda
is a variable.But this is as far as I've looked into it, I don't know the theia code base but I hope this can help someone track this bug down.
OS and Theia version:
This happens on the latest master after enabling semantic highlighting the same way done in this PR.
The text was updated successfully, but these errors were encountered: