mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Added named parameters to autocomplete
This commit is contained in:
parent
7406780f57
commit
a587e6249e
2 changed files with 31 additions and 4 deletions
|
@ -3833,6 +3833,17 @@ namespace IDE.ui
|
||||||
|
|
||||||
bool isEndingChar = (keyChar >= (char8)32) && !keyChar.IsLetterOrDigit && (keyChar != '_') && (keyChar != '~') && (keyChar != '=') && (keyChar != '!') && (keyChar != ':');
|
bool isEndingChar = (keyChar >= (char8)32) && !keyChar.IsLetterOrDigit && (keyChar != '_') && (keyChar != '~') && (keyChar != '=') && (keyChar != '!') && (keyChar != ':');
|
||||||
|
|
||||||
|
if ((mAutoComplete != null) && (mAutoComplete.mAutoCompleteListWidget != null) && (!mAutoComplete.mAutoCompleteListWidget.mEntryList.IsEmpty))
|
||||||
|
{
|
||||||
|
var entry = mAutoComplete.mAutoCompleteListWidget.mEntryList[mAutoComplete.mAutoCompleteListWidget.mSelectIdx];
|
||||||
|
char8 endC = entry.mEntryDisplay[entry.mEntryDisplay.Length - 1];
|
||||||
|
if ((endC == ':') &&
|
||||||
|
(keyChar == endC))
|
||||||
|
{
|
||||||
|
isEndingChar = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (gApp.mSettings.mEditorSettings.mAutoCompleteRequireTab)
|
if (gApp.mSettings.mEditorSettings.mAutoCompleteRequireTab)
|
||||||
{
|
{
|
||||||
doAutocomplete = isCompletionChar;
|
doAutocomplete = isCompletionChar;
|
||||||
|
@ -3954,7 +3965,7 @@ namespace IDE.ui
|
||||||
else
|
else
|
||||||
mAutoComplete.CloseListWindow();
|
mAutoComplete.CloseListWindow();
|
||||||
|
|
||||||
if ((keyChar == '\t') || (keyChar == '\r')) // Let other chars besides explicit-insert chrars pass through
|
if ((keyChar == '\t') || (keyChar == '\r') || (keyChar == ':')) // Let other chars besides explicit-insert chrars pass through
|
||||||
{
|
{
|
||||||
allowChar = false;
|
allowChar = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8172,6 +8172,22 @@ void BfCompiler::GenerateAutocompleteInfo()
|
||||||
{
|
{
|
||||||
if (methodMatchInfo->mInstanceList.size() > 0)
|
if (methodMatchInfo->mInstanceList.size() > 0)
|
||||||
{
|
{
|
||||||
|
if (autoComplete->mIdentifierUsed != NULL)
|
||||||
|
{
|
||||||
|
String filter;
|
||||||
|
if (autoComplete->mIdentifierUsed != NULL)
|
||||||
|
autoComplete->mIdentifierUsed->ToString(filter);
|
||||||
|
|
||||||
|
auto& bestInstance = methodMatchInfo->mInstanceList[methodMatchInfo->mBestIdx];
|
||||||
|
auto bestMethodDef = bestInstance.mMethodDef;
|
||||||
|
for (int paramIdx = 0; paramIdx < bestMethodDef->mParams.mSize; paramIdx++)
|
||||||
|
{
|
||||||
|
if ((paramIdx == 0) && (bestMethodDef->mMethodType == BfMethodType_Extension))
|
||||||
|
continue;
|
||||||
|
autoComplete->AddEntry(AutoCompleteEntry("param", bestMethodDef->mParams[paramIdx]->mName + ":"), filter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String invokeInfoText;
|
String invokeInfoText;
|
||||||
invokeInfoText += StrFormat("%d", methodMatchInfo->mBestIdx);
|
invokeInfoText += StrFormat("%d", methodMatchInfo->mBestIdx);
|
||||||
for (int srcPosIdx = 0; srcPosIdx < (int)methodMatchInfo->mSrcPositions.size(); srcPosIdx++)
|
for (int srcPosIdx = 0; srcPosIdx < (int)methodMatchInfo->mSrcPositions.size(); srcPosIdx++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue