HackStudio: Use Node's name when inserting to the ClassView tree
Previously, when traversing the ClassView tree to find the parent of a new node, we used the name of the node's declaration to find the path to the parent in the tree. However, some nodes in the tree do not have a matching declaration, which caused a VERIFY failure. To fix this, we now use the node's name when walking the tree. We can do this because the node's name should be identical to the name of its declaration. Closes #7702.
This commit is contained in:
parent
2b762ef940
commit
c1b2003687
Notes:
sideshowbarker
2024-07-18 16:53:49 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/c1b20036877 Pull-request: https://github.com/SerenityOS/serenity/pull/7784 Issue: https://github.com/SerenityOS/serenity/issues/7702
1 changed files with 1 additions and 2 deletions
|
@ -147,8 +147,7 @@ void ClassViewModel::add_declaration(const GUI::AutocompleteProvider::Declaratio
|
|||
auto& scope = scope_parts[i];
|
||||
ClassViewNode* next { nullptr };
|
||||
for (auto& child : parent->children) {
|
||||
VERIFY(child.declaration);
|
||||
if (child.declaration->name == scope) {
|
||||
if (child.name == scope) {
|
||||
next = &child;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue