Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

C++ syntax highlighting: Multiple parent classes are not syntax-highlighted if there is a line break in between #245

Open
aeschli opened this issue Jul 11, 2017 · 3 comments
Labels

Comments

@aeschli
Copy link
Contributor

aeschli commented Jul 11, 2017

From @tobbi on July 4, 2017 0:4

  • VSCode Version: Version 1.14.0-insider (1.14.0-insider)
    cea00a71bef01a5ecbae39a8dd4f1bd08fd50c57
    2017-07-03T11:01:02.438Z

  • OS Version: Mac OS X 10.12.5

Steps to Reproduce:

  1. Write the following syntactically correct C++ code:
class SomeClass: public MyClass1,
                 public MyClass2,
                 public MyClass3
{
// Other members and methods and all that stuff.
}
  1. See how public MyClass1 is syntax-highlighted correctly. However, public MyClass1 and public MyClass2 are not getting highlighted at all.

This changes when I put all of the parent classes in one line.

Reproduces without extensions: Yes

image

Copied from original issue: microsoft/vscode#30073

@cbcoutinho
Copy link

Instead of creating a new issue I just wanted to add to this one. Similar to this issue, multiple line class inheritance is not being properly treated as expected. In the project that I'm working on, the original authors decided to put the parent class on the next line.

Notice how the 'BasicTurbulenceModel' parent class is not correctly highlighted:

Seems to be an issue of not correctly taking a newline into consideration.

screenclip

@oktonion
Copy link

Looks like highlighting of any user defined type is broken or not implemented at all. Shame,

fnadeau pushed a commit to fnadeau/language-c that referenced this issue Nov 6, 2017
Allow class declaration and inheritance to be on a separate line.
Also add support for virtual inheritance.
@jeff-hykin
Copy link

jeff-hykin commented Mar 8, 2019

For VS Code this issue has been moved to jeff-hykin/better-cpp-syntax#14

On there I explain why the fix will be difficult. I will still work on a solution though. Hopefully at minimum there can be a fix that will prevent the styles being broken by the multiple lines.

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

5 participants