fix: lambda expression capture support

This commit is contained in:
Roy Qu 2024-03-23 09:13:07 +08:00
parent 09a61c4c32
commit b485e18e04
1 changed files with 7 additions and 4 deletions

View File

@ -701,14 +701,17 @@ void CodeCompletionPopup::getCompletionFor(
if (scopeStatement->lambdaCaptures.contains("&")
|| scopeStatement->lambdaCaptures.contains("=")) {
scopeStatement = scopeStatement->parentScope.lock();
continue;
} else if (scopeStatement->lambdaCaptures.contains("this")) {
do {
scopeStatement = scopeStatement->parentScope.lock();
} while (scopeStatement && scopeStatement->kind!=StatementKind::skClass);
continue;
} while (scopeStatement && scopeStatement->kind!=StatementKind::skClass
&& scopeStatement->kind!=StatementKind::skNamespace);
} else {
do {
scopeStatement = scopeStatement->parentScope.lock();
} while (scopeStatement && scopeStatement->kind!=StatementKind::skNamespace);
}
break;
continue;
}
scopeStatement=scopeStatement->parentScope.lock();
}