mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Added indexers to navigation
This commit is contained in:
parent
633425f902
commit
13c66a7d31
1 changed files with 24 additions and 3 deletions
|
@ -4147,17 +4147,38 @@ void BfCompiler::ProcessAutocompleteTempType()
|
||||||
for (auto propDef : tempTypeDef->mProperties)
|
for (auto propDef : tempTypeDef->mProperties)
|
||||||
{
|
{
|
||||||
auto propDeclaration = BfNodeDynCast<BfPropertyDeclaration>(propDef->mFieldDeclaration);
|
auto propDeclaration = BfNodeDynCast<BfPropertyDeclaration>(propDef->mFieldDeclaration);
|
||||||
if ((propDeclaration == NULL) || (propDeclaration->mNameNode == NULL))
|
if (propDeclaration == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
String propText = propDef->mName;
|
String propText;
|
||||||
|
BfAstNode* refNode = propDeclaration->mNameNode;
|
||||||
|
|
||||||
|
auto indexerDeclaration = BfNodeDynCast<BfIndexerDeclaration>(propDef->mFieldDeclaration);
|
||||||
|
if (indexerDeclaration != NULL)
|
||||||
|
{
|
||||||
|
refNode = indexerDeclaration->mThisToken;
|
||||||
|
propText = "this[";
|
||||||
|
for (int i = 0; i < indexerDeclaration->mParams.mSize; i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
propText += ", ";
|
||||||
|
propText += indexerDeclaration->mParams[i]->ToString();
|
||||||
|
}
|
||||||
|
propText += "]";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (propDeclaration->mNameNode == NULL)
|
||||||
|
continue;
|
||||||
|
propText = propDef->mName;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeName != "@")
|
if (typeName != "@")
|
||||||
propText = typeName + "." + propText;
|
propText = typeName + "." + propText;
|
||||||
|
|
||||||
if (!autoCompleteResultString.empty())
|
if (!autoCompleteResultString.empty())
|
||||||
autoCompleteResultString += "\n";
|
autoCompleteResultString += "\n";
|
||||||
|
|
||||||
BfAstNode* refNode = propDeclaration->mNameNode;
|
|
||||||
module->UpdateSrcPos(refNode, (BfSrcPosFlags)(BfSrcPosFlag_NoSetDebugLoc | BfSrcPosFlag_Force));
|
module->UpdateSrcPos(refNode, (BfSrcPosFlags)(BfSrcPosFlag_NoSetDebugLoc | BfSrcPosFlag_Force));
|
||||||
|
|
||||||
propText += StrFormat("\tproperty\t%d\t%d", module->mCurFilePosition.mCurLine, module->mCurFilePosition.mCurColumn);
|
propText += StrFormat("\tproperty\t%d\t%d", module->mCurFilePosition.mCurLine, module->mCurFilePosition.mCurColumn);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue