public CompletionSession(ITextView textView, ITrackingPoint triggerPoint, bool trackCaret, ICompletionPresenterProvider completionPresenterProvider, Lazy <ICompletionSourceProvider, IOrderableContentTypeMetadata>[] completionSourceProviders) { if (textView == null) { throw new ArgumentNullException(nameof(textView)); } if (triggerPoint == null) { throw new ArgumentNullException(nameof(triggerPoint)); } if (completionPresenterProvider == null) { throw new ArgumentNullException(nameof(completionPresenterProvider)); } if (completionSourceProviders == null) { throw new ArgumentNullException(nameof(completionSourceProviders)); } this.completionCollections = new ObservableCollection <CompletionCollection>(); CompletionCollections = new ReadOnlyObservableCollection <CompletionCollection>(this.completionCollections); Properties = new PropertyCollection(); TextView = textView; this.triggerPoint = triggerPoint; this.completionPresenterProvider = completionPresenterProvider; this.completionSourceProviders = completionSourceProviders; //TODO: Use trackCaret TextView.Closed += TextView_Closed; }
internal void Save( IAsyncCompletionItemManager itemManager, ICompletionPresenterProvider presenterProvider, CompletionSessionState state) { ItemManagerName = CompletionTelemetryHost.GetItemManagerName(itemManager); PresenterProviderName = CompletionTelemetryHost.GetPresenterProviderName(presenterProvider); CompletionState = state; _telemetryHost.Add(this); }
internal void Save( IAsyncCompletionItemManager itemManager, ICompletionPresenterProvider presenterProvider, CompletionSessionState state) { ItemManagerName = CompletionTelemetryHost.GetItemManagerName(itemManager); PresenterProviderName = CompletionTelemetryHost.GetPresenterProviderName(presenterProvider); CompletionState = state; if (NoChanges && BlockingComputationDuration > 0) { UserWaitedForNoChanges = true; } _telemetryHost.Add(this); }
internal static string GetPresenterProviderName(ICompletionPresenterProvider provider) => provider?.GetType().ToString() ?? string.Empty;