mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 08:30:25 +02:00
Properly lock around VerifyTypeName
This commit is contained in:
parent
fb1f538d15
commit
a8a02870dc
2 changed files with 25 additions and 13 deletions
|
@ -282,8 +282,13 @@ namespace IDE.ui
|
||||||
typeName.RemoveFromStart(1);
|
typeName.RemoveFromStart(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gApp.mBfResolveCompiler.VerifyTypeName(scope String(typeName), -1))
|
if (gApp.mBfResolveCompiler?.IsPerformingBackgroundOperation() == false)
|
||||||
isValid = false;
|
{
|
||||||
|
gApp.mBfResolveSystem.Lock(0);
|
||||||
|
if (!gApp.mBfResolveCompiler.VerifyTypeName(scope String(typeName), -1))
|
||||||
|
isValid = false;
|
||||||
|
gApp.mBfResolveSystem.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
subItem.mTextColor = isValid ? 0xFFFFFFFF : 0xFFFF8080;
|
subItem.mTextColor = isValid ? 0xFFFFFFFF : 0xFFFF8080;
|
||||||
|
|
|
@ -51,12 +51,15 @@ namespace IDE.ui
|
||||||
editText.RemoveToEnd(semiPos);
|
editText.RemoveToEnd(semiPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValid;
|
bool isValid = true;
|
||||||
if (editText.StartsWith("@"))
|
if (!editText.StartsWith("@"))
|
||||||
isValid = true;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
isValid = gApp.mBfResolveCompiler.VerifyTypeName(editText, cursorPos);
|
if (gApp.mBfResolveCompiler?.IsPerformingBackgroundOperation() == false)
|
||||||
|
{
|
||||||
|
gApp.mBfResolveSystem.Lock(0);
|
||||||
|
isValid = gApp.mBfResolveCompiler.VerifyTypeName(editText, cursorPos);
|
||||||
|
gApp.mBfResolveSystem.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int ofs < editText.Length)
|
for (int ofs < editText.Length)
|
||||||
|
@ -102,15 +105,19 @@ namespace IDE.ui
|
||||||
typeName.RemoveFromStart(1);
|
typeName.RemoveFromStart(1);
|
||||||
startOfs++;
|
startOfs++;
|
||||||
}
|
}
|
||||||
|
if (gApp.mBfResolveCompiler?.IsPerformingBackgroundOperation() == false)
|
||||||
bool isValid = gApp.mBfResolveCompiler.VerifyTypeName(scope String(typeName), -1);
|
|
||||||
if (!isValid)
|
|
||||||
{
|
{
|
||||||
for (int ofs < typeName.Length)
|
gApp.mBfResolveSystem.Lock(0);
|
||||||
|
bool isValid = gApp.mBfResolveCompiler.VerifyTypeName(scope String(typeName), -1);
|
||||||
|
if (!isValid)
|
||||||
{
|
{
|
||||||
text[@typeName.Pos + startOfs + ofs].mDisplayTypeId = 1;
|
for (int ofs < typeName.Length)
|
||||||
|
{
|
||||||
|
text[@typeName.Pos + startOfs + ofs].mDisplayTypeId = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
gApp.mBfResolveSystem.Unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue