| 4401 | } |
| 4402 | |
| 4403 | void DbgExprEvaluator::AutocompleteAddMembers(DbgType* dbgType, bool wantsStatic, bool wantsNonStatic, const StringImpl& filter, bool isCapture) |
| 4404 | { |
| 4405 | if (mStackSearch != NULL) |
| 4406 | { |
| 4407 | if (!mStackSearch->mAutocompleteSearchedTypes.Add(dbgType)) |
| 4408 | return; |
| 4409 | } |
| 4410 | |
| 4411 | DbgLanguage language = GetLanguage(); |
| 4412 | DbgFlavor flavor = GetFlavor(); |
| 4413 | if ((mDbgCompileUnit != NULL) && (dbgType->mLanguage != DbgLanguage_Unknown) && (dbgType->mLanguage != language)) |
| 4414 | return; |
| 4415 | |
| 4416 | dbgType->PopulateType(); |
| 4417 | if (dbgType->mNeedsGlobalsPopulated) |
| 4418 | mDbgModule->PopulateTypeGlobals(dbgType); |
| 4419 | |
| 4420 | // Don't get primary type for namespace, causes mAlternates infinite loop |
| 4421 | if (!dbgType->IsNamespace()) |
| 4422 | dbgType = dbgType->GetPrimaryType(); |
| 4423 | |
| 4424 | // false/false means just add subtypes |
| 4425 | if ((wantsStatic) || (!wantsNonStatic)) |
| 4426 | { |
| 4427 | auto subType = dbgType->mSubTypeList.mHead; |
| 4428 | while (subType != NULL) |
| 4429 | { |
| 4430 | if (subType->mLanguage != language) |
| 4431 | { |
| 4432 | // Ignore |
| 4433 | } |
| 4434 | else if (subType->mTypeName == NULL) |
| 4435 | { |
| 4436 | AutocompleteAddMembers(subType, wantsStatic, wantsNonStatic, filter); |
| 4437 | } |
| 4438 | else |
| 4439 | { |
| 4440 | bool allowType = true; |
| 4441 | for (const char* cPtr = subType->mTypeName; *cPtr != '\0'; cPtr++) |
| 4442 | { |
| 4443 | char c = *cPtr; |
| 4444 | if ((c == '`') || (c == '[') || (c == '.') || (c == '$') || (c == '(')) |
| 4445 | allowType = false; |
| 4446 | } |
| 4447 | |
| 4448 | if ((allowType) && (subType->IsNamespace())) |
| 4449 | { |
| 4450 | // Is it a "using" declaration? |
| 4451 | if ((!dbgType->IsRoot()) && (!dbgType->IsNamespace())) |
| 4452 | allowType = false; |
| 4453 | } |
| 4454 | |
| 4455 | if ((!subType->IsAnonymous()) && (!subType->IsSizedArray()) && (allowType)) |
| 4456 | { |
| 4457 | mDbgModule->TempRemoveTemplateStr(subType->mTypeName, subType->mTemplateNameIdx); |
| 4458 | // We set the true mEntryType after the filter passes. This is because IsBfObject() is a "heavyweight" operation that we don't want to |
| 4459 | // just run on ALL types immediately |
| 4460 | AutoCompleteEntry* entry = mAutoComplete->AddEntry(AutoCompleteEntry("type", subType->mTypeName), filter); |
nothing calls this directly
no test coverage detected