-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Feature: Code FoldingLanguage ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobug
Milestone
Description
Bug type: Language Service
Bug description
- OS and Version: Ubuntu 18.04
- VS Code Version: 1.58.2
- C/C++ Extension Version: 1.5.1
- Code folding for class constructor is not generated correctly when curly brackets are used form member initialization.
Expected behavior
For the following code - as could be seen by attached screenshots - the folds are not properly generated for class constructors.
The problem seems to be the use of curly brackets for member initialization. In case the round brackets are use for initialization, folds seem to be generated properly.
Code sample
#include <string>
using first_long_type_name = int;
using second_long_type_name = float;
class A
{
first_long_type_name first_long_name;
second_long_type_name second_long_name;
std::string third_long_name;
public:
A(first_long_type_name a, second_long_type_name b,
const std::string &c);
int value();
};
A::A(first_long_type_name a, second_long_type_name b, const std::string &c)
: first_long_name{a},
second_long_name{b},
third_long_name{c}
{
std::string some{"dummy code"};
int to_fill_the_body{3};
}
int A::value()
{
return first_long_name;
}
class B : public A
{
bool foo;
public:
B(bool a, first_long_type_name b, second_long_type_name c);
};
B::B(bool a, first_long_type_name b, second_long_type_name c)
: A{b, c,
"Some very very very long long string used for demonstration purposes"},
foo{a}
{
std::string some_body_code;
}
Screenshots
Screenshots represent folds, generated without the use of extension's language server, folds, generated with the use of extension's language server where curly brackets were used and the use of round brackets for member initialization in the first class constructor.
damides and MathiasMagnus
Metadata
Metadata
Assignees
Labels
Feature: Code FoldingLanguage ServiceVisual StudioInherited from Visual StudioInherited from Visual Studiobug