internal static IEnumerable <IIntellisenseResult> CreateResultsGeneric(IEnumerable <IDev2DataLanguageIntellisensePart> refParts, IParseTO payload, string search, bool addCompleteParts) { IList <IIntellisenseResult> result = new List <IIntellisenseResult>(); if (payload.HangingOpen) { var hasIndex = false; var openBraceIndex = search.LastIndexOf(DataListUtil.RecordsetIndexOpeningBracket, StringComparison.Ordinal); var closeBraceIndex = search.LastIndexOf(DataListUtil.RecordsetIndexClosingBracket, StringComparison.Ordinal); if (openBraceIndex != -1 && openBraceIndex < search.Length && closeBraceIndex > openBraceIndex) { hasIndex = true; } var isRecordsetIndexOpeningBracket = payload.Payload.Contains(DataListUtil.RecordsetIndexOpeningBracket); var isRecordsetIndexClosingBracket = !payload.Payload.Contains(DataListUtil.RecordsetIndexClosingBracket); var isPayloadChildEmpty = payload.Child == null; if (isRecordsetIndexOpeningBracket && isRecordsetIndexClosingBracket && isPayloadChildEmpty && !hasIndex) { Add.AddIndex(refParts, payload, search, result); } else { Add.AddFoundItems(refParts, payload, search, addCompleteParts, result); } } return(result); }