public void VsTextViewCreated(IVsTextView textViewAdapter) { ITextView textView = _adapterService.GetWpfTextView(textViewAdapter); if (textView == null) { return; } ITextDocument textDocument; textView.TextBuffer.Properties.TryGetProperty(typeof(ITextDocument), out textDocument); object commandHandler; if (!textView.Properties.TryGetProperty("CompletionCommandHandler", out commandHandler)) { var handler = RuntimeLoader.CreateCommandHandler(textDocument.FilePath, _serviceProvider, textViewAdapter, textView, _navigatorService, _signatureHelpBroker, _completionBroker); textView.Properties.AddProperty("CompletionCommandHandler", handler); } }