public override void SelectBestMatch() { ITextSnapshot snapshot = ApplicableTo.TextBuffer.CurrentSnapshot; string typedText = ApplicableTo.GetText(snapshot); if (string.IsNullOrWhiteSpace(typedText)) { if (this.WritableCompletions.Any()) { SelectionStatus = new CompletionSelectionStatus(WritableCompletions.First(), true, true); } return; } foreach (CrmCompletion comp in WritableCompletions) { if (comp.IsMatch(typedText)) { SelectionStatus = new CompletionSelectionStatus(comp, true, true); return; } } }
public override void SelectBestMatch() { ITextSnapshot snapshot = ApplicableTo.TextBuffer.CurrentSnapshot; string typedText = ApplicableTo.GetText(snapshot); if (string.IsNullOrWhiteSpace(typedText)) { if (this.WritableCompletions.Any()) { SelectionStatus = new CompletionSelectionStatus(WritableCompletions.First(), true, true); } return; } foreach (Completion comp in WritableCompletions) { if (comp.DisplayText.IndexOf(typedText, StringComparison.InvariantCultureIgnoreCase) > -1) { SelectionStatus = new CompletionSelectionStatus(comp, true, true); return; } } }