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

Method CheckIdentifier

IDEHelper/Compiler/BfAutoComplete.cpp:1617–1895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1615}
1616
1617void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpression, bool isUsingDirective)
1618{
1619 if ((identifierNode != NULL) && (!IsAutocompleteNode(identifierNode)))
1620 return;
1621
1622 mIdentifierUsed = identifierNode;
1623
1624 if ((mModule->mParentNodeEntry != NULL) && (mModule->mCurMethodState != NULL))
1625 {
1626 if (auto binExpr = BfNodeDynCast<BfBinaryOperatorExpression>(mModule->mParentNodeEntry->mNode))
1627 {
1628 auto parentBlock = mModule->mCurMethodState->mCurScope->mAstBlock;
1629 if ((identifierNode == binExpr->mRight) && (binExpr->mOp == BfBinaryOp_Multiply) && (parentBlock != NULL))
1630 {
1631 // If we are the last identifier in a block then we MAY be a partially-typed variable declaration
1632 if (parentBlock->mChildArr.back() == binExpr)
1633 {
1634 mUncertain = true;
1635 }
1636 }
1637 }
1638 }
1639
1640 if (auto qualifiedNameNode = BfNodeDynCast<BfQualifiedNameNode>(identifierNode))
1641 {
1642 CheckMemberReference(qualifiedNameNode->mLeft, qualifiedNameNode->mDot, qualifiedNameNode->mRight, false, NULL, isUsingDirective);
1643 return;
1644 }
1645
1646 AddTopLevelNamespaces(identifierNode);
1647 if (isUsingDirective)
1648 return; // Only do namespaces
1649
1650 AddTopLevelTypes(identifierNode);
1651
1652 String filter;
1653 if (identifierNode != NULL)
1654 {
1655 filter = identifierNode->ToString();
1656 mInsertStartIdx = identifierNode->GetSrcStart();
1657 mInsertEndIdx = identifierNode->GetSrcEnd();
1658 }
1659
1660 String addStr;
1661
1662 if (mShowAttributeProperties != NULL)
1663 {
1664 auto showAttrTypeDef = mShowAttributeProperties->mTypeDef;
1665 for (auto prop : showAttrTypeDef->mProperties)
1666 {
1667 if (auto entryAdded = AddEntry(AutoCompleteEntry("property", prop->mName + "="), filter))
1668 {
1669 auto propertyDeclaration = prop->GetFieldDeclaration();
1670 if (propertyDeclaration != NULL)
1671 {
1672 if (CheckDocumentation(entryAdded, propertyDeclaration->mDocumentation))
1673 {
1674 }

Callers 7

DoIfStatementMethod · 0.80
VisitMethod · 0.80
GetCustomAttributesMethod · 0.80
VisitMethod · 0.80
DoInvocationMethod · 0.80

Calls 15

AutoCompleteEntryClass · 0.85
GetFieldDeclarationMethod · 0.80
GetStaticSearchMethod · 0.80
GetCeDbgStateMethod · 0.80
GetInstIdxMethod · 0.80
GetRootMethodStateMethod · 0.80
backMethod · 0.45
ToStringMethod · 0.45
GetSrcStartMethod · 0.45
GetSrcEndMethod · 0.45
IsEmptyMethod · 0.45

Tested by

no test coverage detected