- fix #374: Can't find the correct type if current symbol is member of a class that has constructors.

This commit is contained in:
Roy Qu 2024-04-08 11:47:53 +08:00
parent 8ebfeec97d
commit cbd6559ddc
2 changed files with 3 additions and 0 deletions

View File

@ -128,6 +128,7 @@ Red Panda C++ Version 2.27
- enhancement: Size of icons in the completion popup changes with the editor font size. - enhancement: Size of icons in the completion popup changes with the editor font size.
- change: Completion popup size settings are based on editor's char width/line height. - change: Completion popup size settings are based on editor's char width/line height.
- change: Remove "limit for copy" and "limit for undo" options. - change: Remove "limit for copy" and "limit for undo" options.
- fix: Can't find the correct type if current symbol is member of a class that has constructors.
Red Panda C++ Version 2.26 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -2603,6 +2603,8 @@ PStatement CppParser::getTypeDef(const PStatement& statement,
|| statement->kind == StatementKind::EnumType || statement->kind == StatementKind::EnumType
|| statement->kind == StatementKind::EnumClassType) { || statement->kind == StatementKind::EnumClassType) {
return statement; return statement;
} else if (statement->kind == StatementKind::Constructor) {
return statement->parentScope.lock();
} else if (statement->kind == StatementKind::Typedef) { } else if (statement->kind == StatementKind::Typedef) {
if (statement->type == aType) // prevent infinite loop if (statement->type == aType) // prevent infinite loop
return statement; return statement;