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

Parameter names are not highlighted #158

Closed
arzaidi opened this issue May 10, 2019 · 17 comments · Fixed by #165
Closed

Parameter names are not highlighted #158

arzaidi opened this issue May 10, 2019 · 17 comments · Fixed by #165
Labels
🐛 Bug Something isn't working

Comments

@arzaidi
Copy link

arzaidi commented May 10, 2019

I have just started using Visual Studio Code, and installed your extension but it doesn't change anything in C++ syntax highlighting.
I am using Visual Studio Code - Insiders Version : 1.34.20

Attaching snapshot where you can see that the parameter type and name colors are unchanged.

Capture

@matter123
Copy link
Collaborator

Vscode insiders is already using 1.8.8 so there should be only minor improvements at the moment. Though that might be a bug.

@matter123
Copy link
Collaborator

Parameters type highlighting is being tracker by #135. We hope to get that merged in tonight.

@matter123
Copy link
Collaborator

Is what still white after disabling "Custom C++ Highlighting" and reloading?

@jeff-hykin
Copy link
Owner

jeff-hykin commented May 10, 2019

@arzaidi The extension is the bleeding edge updates to the syntax, kind of like Chrome Canary, or Firefox nightlies. Sometimes there will be a big difference, however VS Code uses the extension to get official updates to the syntax once it the changes have proven to be stable.

As matter123 pointed out, right now there are not that many differences between the VS Code Insiders release and the Better C++ extension. If you're using the normal VS Code release though its quiet different.

@jeff-hykin
Copy link
Owner

You might also need a theme that highlights more pieces of the syntax, since the default VS Code theme highlights very little.

@matter123
Copy link
Collaborator

Screenshot from 2019-05-10 15-16-13

Yeah, the Dark (Visual Studio) theme does not have coloring for variable.parameter.

With Dark + (default dark) you can see that what and throwExcp are highlighted.
Screenshot from 2019-05-10 15-17-40

Closing as this is a theme color issue. See #7 if you want to customize your theme.

@matter123 matter123 added the theme-color More related to theme than it is the syntax label May 10, 2019
@arzaidi
Copy link
Author

arzaidi commented May 13, 2019

Thanks guys. I think there is some other issue here, as when I inspect, my variables are not marked as variables. I assume some different tokenization related extension needed?
Capture2

@matter123
Copy link
Collaborator

Huh

@matter123 matter123 reopened this May 13, 2019
@matter123 matter123 added 🔍 investigating More information is being gathered and removed theme-color More related to theme than it is the syntax labels May 13, 2019
@matter123
Copy link
Collaborator

Is that the whole file?

@matter123 matter123 changed the title Doesn't highlight as expected. parameter names are not highlighted May 13, 2019
@matter123 matter123 changed the title parameter names are not highlighted Parameter names are not highlighted May 13, 2019
@arzaidi
Copy link
Author

arzaidi commented May 13, 2019

no thats not the whole file, it has usual includes and namespace etc on the top

@jeff-hykin
Copy link
Owner

If you can link the whole file we'll take a look into it. This is a pretty suprising bug.

@matter123
Copy link
Collaborator

It is marked as meta.function-call, are you defining a function while inside a function?

@arzaidi
Copy link
Author

arzaidi commented May 13, 2019

Found the root cause, it is due to the use of unnamed namespace. If you provide a name to the namespace then it works fine. Here is the sample to reproduce:

#include "sample.h"
namespace
{
void failedToLoadCriticalData(const string& what, bool throwExcp = false)
{
}
}

@matter123
Copy link
Collaborator

matter123 commented May 13, 2019

Probably the same issue/root cause as #72 then. Thanks.

@matter123 matter123 added 🐛 Bug Something isn't working and removed 🔍 investigating More information is being gathered labels May 13, 2019
@matter123
Copy link
Collaborator

@arzaidi
I meant that This and #72 had the same root cause, where the opening pattern expected a space then a {, not that is was exactly the same issue. If you want to test the fix for your issue #165 has its syntax file at https://raw.githubusercontent.com/jeff-hykin/cpp-textmate-grammar/fix/%23158/syntaxes/cpp.tmLanguage.json.

@arzaidi
Copy link
Author

arzaidi commented May 13, 2019

great. Thank you guys, I used this file and it fixed the issue.

@jeff-hykin
Copy link
Owner

I'll try to get matter123's merged into master in the next 2 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants