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

Method FindFixitNamespaces

IDEHelper/Compiler/BfSystem.cpp:2958–2986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2956}
2957
2958void BfSystem::FindFixitNamespaces(const StringImpl& typeName, int numGenericArgs, BfProject* project, std::set<String>& fixitNamespaces)
2959{
2960 BfAtomComposite findName;
2961 if (!ParseAtomComposite(typeName, findName))
2962 return;
2963
2964 // The algorithm assumes the first (or only) part of the BfAtomComposite is a type name, and finds a type with that matching
2965 // name and then adds its namespace to the fixitNamespaces
2966
2967 for (auto typeDef : mTypeDefs)
2968 {
2969 if ((typeDef->mName == findName.mParts[0]) &&
2970 (CheckTypeDefReference(typeDef, project)) &&
2971 ((numGenericArgs == -1) || (typeDef->mGenericParamDefs.size() == numGenericArgs)))
2972 {
2973 String outerName;
2974 if (typeDef->mOuterType != NULL)
2975 {
2976 if (!typeDef->mGenericParamDefs.IsEmpty())
2977 continue;
2978 outerName += "static ";
2979 outerName += typeDef->mOuterType->mFullName.ToString();
2980 }
2981 else
2982 outerName = typeDef->mNamespace.ToString();
2983 fixitNamespaces.insert(outerName);
2984 }
2985 }
2986}
2987
2988void BfSystem::RemoveTypeDef(BfTypeDef* typeDef)
2989{

Callers 1

CheckTypeRefFixitMethod · 0.80

Calls 3

sizeMethod · 0.45
IsEmptyMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected