public static ISuggestedActionsSource FromViewAndBuffer(ITextView textView, ITextBuffer textBuffer, ICoreShell shell) { var suggestedActionsSource = ServiceManager.GetService<RSuggestedActionSource>(textView); if (suggestedActionsSource == null) { IEnumerable<IRSuggestedActionProvider> suggestedActionProviders = ComponentLocator<IRSuggestedActionProvider>.ImportMany(shell.CompositionService).Select(p => p.Value); suggestedActionsSource = new RSuggestedActionSource(textView, textBuffer, suggestedActionProviders, shell); } return suggestedActionsSource; }
public static ISuggestedActionsSource FromViewAndBuffer(ITextView textView, ITextBuffer textBuffer) { var suggestedActionsSource = ServiceManager.GetService <RSuggestedActionSource>(textView); if (suggestedActionsSource == null) { IEnumerable <IRSuggestedActionProvider> suggestedActionProviders = ComponentLocator <IRSuggestedActionProvider> .ImportMany().Select(p => p.Value); suggestedActionsSource = new RSuggestedActionSource(textView, textBuffer, suggestedActionProviders); } return(suggestedActionsSource); }
public static ISuggestedActionsSource FromViewAndBuffer(ITextView textView, ITextBuffer textBuffer, ICoreShell shell) { var suggestedActionsSource = ServiceManager.GetService <RSuggestedActionSource>(textView); if (suggestedActionsSource == null) { // Check for detached documents in the interactive window projected buffers var document = REditorDocument.TryFromTextBuffer(textBuffer); if (document == null || document.IsClosed) { return(null); } IEnumerable <IRSuggestedActionProvider> suggestedActionProviders = ComponentLocator <IRSuggestedActionProvider> .ImportMany(shell.CompositionService).Select(p => p.Value); suggestedActionsSource = new RSuggestedActionSource(textView, textBuffer, suggestedActionProviders, shell); } return(suggestedActionsSource); }
public ISuggestedActionsSource CreateSuggestedActionsSource(ITextView textView, ITextBuffer textBuffer) { return(RSuggestedActionSource.FromViewAndBuffer(textView, textBuffer, _shell)); }
public ISuggestedActionsSource CreateSuggestedActionsSource(ITextView textView, ITextBuffer textBuffer) => textView.Properties.GetOrCreateSingletonProperty(() => RSuggestedActionSource.FromViewAndBuffer(textView, textBuffer, _shell));