MCPcopy Create free account
hub / github.com/beefytech/Beef / AddTopLevelNamespaces

Method AddTopLevelNamespaces

IDEHelper/Compiler/BfAutoComplete.cpp:1446–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1444}
1445
1446void 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
1485void BfAutoComplete::AddTopLevelTypes(BfAstNode* identifierNode, bool onlyAttribute)
1486{

Callers 1

Calls 6

AutoCompleteEntryClass · 0.85
GetPartsCountMethod · 0.80
ToStringMethod · 0.45
GetSrcStartMethod · 0.45
GetSrcEndMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected