| 1444 | } |
| 1445 | |
| 1446 | void BfAutoComplete::AddTopLevelNamespaces(BfAstNode* identifierNode) |
| 1447 | { |
| 1448 | String filter; |
| 1449 | if (identifierNode != NULL) |
| 1450 | { |
| 1451 | filter = identifierNode->ToString(); |
| 1452 | mInsertStartIdx = identifierNode->GetSrcStart(); |
| 1453 | mInsertEndIdx = identifierNode->GetSrcEnd(); |
| 1454 | } |
| 1455 | |
| 1456 | BfProject* bfProject = GetActiveProject(); |
| 1457 | |
| 1458 | auto _AddProjectNamespaces = [&](BfProject* project) |
| 1459 | { |
| 1460 | for (auto namespacePair : project->mNamespaces) |
| 1461 | { |
| 1462 | const BfAtomComposite& namespaceComposite = namespacePair.mKey; |
| 1463 | if (namespaceComposite.GetPartsCount() == 1) |
| 1464 | { |
| 1465 | AddEntry(AutoCompleteEntry("namespace", namespaceComposite.ToString()), filter); |
| 1466 | } |
| 1467 | } |
| 1468 | }; |
| 1469 | |
| 1470 | if (bfProject != NULL) |
| 1471 | { |
| 1472 | for (int depIdx = -1; depIdx < (int) bfProject->mDependencies.size(); depIdx++) |
| 1473 | { |
| 1474 | BfProject* depProject = (depIdx == -1) ? bfProject : bfProject->mDependencies[depIdx]; |
| 1475 | _AddProjectNamespaces(depProject); |
| 1476 | } |
| 1477 | } |
| 1478 | else |
| 1479 | { |
| 1480 | for (auto project : mSystem->mProjects) |
| 1481 | _AddProjectNamespaces(project); |
| 1482 | } |
| 1483 | } |
| 1484 | |
| 1485 | void BfAutoComplete::AddTopLevelTypes(BfAstNode* identifierNode, bool onlyAttribute) |
| 1486 | { |
no test coverage detected