public void AugmentCompletionSession(Intel.ICompletionSession session, IList<Intel.CompletionSet> completionSets) { var position = session.GetTriggerPoint(_buffer).GetPoint(_buffer.CurrentSnapshot); var line = position.GetContainingLine(); if (line == null) { return; } var text = line.GetText(); var linePosition = position - line.Start; foreach (var source in completionSources) { var span = source.GetInvocationSpan(text, linePosition, position); if (span == null) continue; if (span.Value.Length == 0) return; var trackingSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(span.Value.Start + line.Start, span.Value.Length, SpanTrackingMode.EdgeInclusive); completionSets.Add(new StringCompletionSet( source.GetType().Name, trackingSpan, source.GetEntries(text[span.Value.Start], session.TextView.Caret.Position.BufferPosition) )); } }
bool VSLI.IIntellisenseCommandTarget.ExecuteKeyboardCommand(VSLI.IntellisenseKeyboardCommand command) { switch (command) { case VSLI.IntellisenseKeyboardCommand.Escape: session.Dismiss(); return true; case VSLI.IntellisenseKeyboardCommand.Up: case VSLI.IntellisenseKeyboardCommand.Down: case VSLI.IntellisenseKeyboardCommand.PageUp: case VSLI.IntellisenseKeyboardCommand.PageDown: case VSLI.IntellisenseKeyboardCommand.Home: case VSLI.IntellisenseKeyboardCommand.End: case VSLI.IntellisenseKeyboardCommand.TopLine: case VSLI.IntellisenseKeyboardCommand.BottomLine: case VSLI.IntellisenseKeyboardCommand.Enter: case VSLI.IntellisenseKeyboardCommand.IncreaseFilterLevel: case VSLI.IntellisenseKeyboardCommand.DecreaseFilterLevel: default: return false; } }
public SimpleHtmlCompletion(string displayText, string description, vs.ICompletionSession session) : base(displayText, displayText, description, _glyph, HtmlIconAutomationText.AttributeIconText, session) { }
public TsCommandFilter(IWpfTextView textView, Intel.ICompletionBroker CompletionBroker, IStandardClassificationService standardClassifications) { TextView = textView; Broker = CompletionBroker; _standardClassifications = standardClassifications; }
public SimpleHtmlCompletion(string displayText, string description, string insertion, ImageSource glyph, vs.ICompletionSession session) : base(displayText, insertion, description, glyph, HtmlIconAutomationText.AttributeIconText, session) { }
public PaketKeywordCompletionListProvider(Intel.IGlyphService glyphService) { glyph = glyphService.GetGlyph(Intel.StandardGlyphGroup.GlyphGroupVariable, Intel.StandardGlyphItem.GlyphItemPublic); }
bool ExecuteKeyboardCommand(VSLI.IntellisenseKeyboardCommand command) { foreach (var session in sessions) { if ((session.Presenter as VSLI.IIntellisenseCommandTarget)?.ExecuteKeyboardCommand(command) == true) return true; } return false; }