public void AugmentPeekSession(IPeekSession session, IList <IPeekableItem> peekableItems) { try { XSharpModel.ModelWalker.Suspend(); if (!string.Equals(session.RelationshipName, PredefinedPeekRelationships.Definitions.Name, StringComparison.OrdinalIgnoreCase)) { return; } // var tp = session.GetTriggerPoint(_textBuffer.CurrentSnapshot); if (!tp.HasValue) { return; } var triggerPoint = tp.Value; // LookUp for the BaseType, reading the TokenList (From left to right) var location = _textBuffer.FindLocation(triggerPoint); if (location == null) { return; } CompletionState state; var tokenList = XSharpTokenTools.GetTokensUnderCursor(location, out state); var result = new List <IXSymbol>(); result.AddRange(XSharpLookup.RetrieveElement(location, tokenList, state, out var notProcessed, true)); // if (result.Count > 0) { if (result[0] is XSourceSymbol symbol) { peekableItems.Add(new XSharpDefinitionPeekItem(symbol, _peekResultFactory)); } else if (result[0] is XPESymbol pesymbol) { XPETypeSymbol petype; if (pesymbol is XPETypeSymbol) { petype = (XPETypeSymbol)pesymbol; } else if (pesymbol is XPEMemberSymbol member) { petype = (XPETypeSymbol)member.Parent; } else { return; } var file = XSharpGotoDefinition.CreateFileForSystemType(petype, pesymbol); var entity = XSharpGotoDefinition.FindElementInFile(file, petype, pesymbol); if (entity != null) { peekableItems.Add(new XSharpDefinitionPeekItem(entity, _peekResultFactory)); } } } } catch (Exception ex) { XSettings.LogException(ex, "XSharpPeekItemSource.AugmentPeekSession failed : "); } finally { ModelWalker.Resume(); } }