public List <Completion> GetCompletionListNoRetry( int index, bool assertIfNoCompletions = true, ITextSnapshot snapshot = null ) { VS.Invoke(() => { snapshot = snapshot ?? CurrentSnapshot; if (index < 0) { index += snapshot.Length + 1; } View.MoveCaret(new SnapshotPoint(snapshot, index)); View.MemberList(); }); using (var sh = View.WaitForSession <ICompletionSession>(assertIfNoSession: assertIfNoCompletions)) { if (sh == null) { return(new List <Completion>()); } Assert.AreNotEqual(0, sh.Session.CompletionSets.Count); return(sh.Session.CompletionSets.SelectMany(cs => cs.Completions) .Where(c => !string.IsNullOrEmpty(c?.InsertionText)) .ToList()); } }
public List <Completion> GetCompletionList( int index, bool assertIfNoCompletions = true, ITextSnapshot snapshot = null ) { snapshot = snapshot ?? CurrentSnapshot; if (index < 0) { index += snapshot.Length + 1; } View.MoveCaret(new SnapshotPoint(snapshot, index)); VS.Invoke(() => View.MemberList()); using (var sh = View.WaitForSession <ICompletionSession>(assertIfNoSession: assertIfNoCompletions)) { if (sh == null) { return(new List <Completion>()); } return(sh.Session.CompletionSets.SelectMany(cs => cs.Completions).ToList()); } }