Inheritance: ISuggestedActionsSource
示例#1
0
 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);
        }
示例#3
0
        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));
 }
示例#5
0
 public ISuggestedActionsSource CreateSuggestedActionsSource(ITextView textView, ITextBuffer textBuffer)
 => textView.Properties.GetOrCreateSingletonProperty(() => RSuggestedActionSource.FromViewAndBuffer(textView, textBuffer, _shell));