mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed renaming of globals
This commit is contained in:
parent
234b3064ff
commit
6e485e5766
2 changed files with 31 additions and 2 deletions
|
@ -6750,7 +6750,9 @@ void BfCompiler::GenerateAutocompleteInfo()
|
|||
|
||||
auto _EncodeTypeDef = [] (BfTypeDef* typeDef)
|
||||
{
|
||||
String typeName = typeDef->mProject->mName + ":" + typeDef->mFullName.ToString();
|
||||
StringT<128> typeName = typeDef->mProject->mName;
|
||||
typeName += ":";
|
||||
typeName += typeDef->mFullName.ToString();
|
||||
if (!typeDef->mGenericParamDefs.IsEmpty())
|
||||
typeName += StrFormat("`%d", (int)typeDef->mGenericParamDefs.size());
|
||||
return typeName;
|
||||
|
|
|
@ -1912,6 +1912,9 @@ void BfSystem::ProcessAtomGraveyard()
|
|||
|
||||
bool BfSystem::ParseAtomComposite(const StringView& name, BfAtomComposite& composite, bool addRefs)
|
||||
{
|
||||
if (name.mLength == 0)
|
||||
return true;
|
||||
|
||||
bool isValid = true;
|
||||
|
||||
SizedArray<BfAtom*, 6> parts;
|
||||
|
@ -2418,7 +2421,31 @@ BfTypeDef* BfSystem::FindTypeDefEx(const StringImpl& fullTypeName)
|
|||
typeName.RemoveToEnd(tildePos);
|
||||
}
|
||||
|
||||
return FindTypeDef(typeName, numGenericArgs, project);
|
||||
BfAtomComposite qualifiedFindName;
|
||||
BfAtom* tempData[16];
|
||||
qualifiedFindName.mAllocSize = 16;
|
||||
qualifiedFindName.mParts = tempData;
|
||||
|
||||
BfTypeDef* result = NULL;
|
||||
if (ParseAtomComposite(typeName, qualifiedFindName))
|
||||
{
|
||||
auto itr = mTypeDefs.TryGet(qualifiedFindName);
|
||||
while (itr)
|
||||
{
|
||||
BfTypeDef* typeDef = *itr;
|
||||
if ((typeDef->mFullName == qualifiedFindName) && (CheckTypeDefReference(typeDef, project)) &&
|
||||
(!typeDef->mIsPartial))
|
||||
{
|
||||
if (typeDef->mGenericParamDefs.size() != numGenericArgs)
|
||||
continue;
|
||||
return typeDef;
|
||||
}
|
||||
itr.MoveToNextHashMatch();
|
||||
}
|
||||
}
|
||||
if (qualifiedFindName.mParts == tempData)
|
||||
qualifiedFindName.mParts = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
void BfSystem::FindFixitNamespaces(const StringImpl& typeName, int numGenericArgs, BfProject* project, std::set<String>& fixitNamespaces)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue