public CompletionSource(ITextView textView) { _textView = textView; if (!Workspace.TryGetWorkspace(textView.TextBuffer.AsTextContainer(), out var workspace)) { throw new InvalidOperationException(); } _completionService = workspace.Services.GetLanguageServices(textView.TextBuffer).GetService <CompletionService>(); }