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

Code highlighting fails if casting to a certain syntax of pointer #3741

Closed
chuggafan opened this issue Jun 7, 2019 · 3 comments
Closed

Code highlighting fails if casting to a certain syntax of pointer #3741

chuggafan opened this issue Jun 7, 2019 · 3 comments
Labels

Comments

@chuggafan
Copy link

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 latest
  • VS Code Version: 1.35
  • C/C++ Extension Version: 0.23.1
  • Other extensions you installed (and if the issue persists after disabling them): Git lens (issue persists)
  • A clear and concise description of what the bug is.
    Color highlighting fails for the rest of the line if you cast like this:
void* func()
{
return nullptr;
}
enum var
{

};
void func2()
{
    enum var** thing = (enum var**)func();
}

For the rest of the line after the cast to enum var** the colorization does not work, this is the same if you use struct as the keyword instead of var. I think it has to do with expecting C++ style structure casting vs. C, although c++ can use both.

Here's a screenshot showing my example and its highlighting.
syntax

@chuggafan chuggafan changed the title Code highlighting fails if casting return to a certain syntax of pointer Code highlighting fails if casting to a certain syntax of pointer Jun 7, 2019
@Colengms
Copy link
Collaborator

Colengms commented Jun 7, 2019

Hi @chuggafan,

Currently, colorization is provided by VS Code. It uses TextMate grammar to colorize. You might get improved results with this extension.

We are actually in the process of implementing colorization based on IntelliSense, which we hope to include in the next release of the C/C++ extension.

  • Colen

@jeff-hykin
Copy link

Temp fix was created just now on v1.11.7 of the extension. There's likely a similar case with enums that will probably get fixed sometime this weekend.

@Colengms
Copy link
Collaborator

Closing as this is no longer repro'ing in VS Code.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants