public static IEnumerable <IVocabulary> GetAllVocabularies() { if (_vocabularies == null) { _vocabularies = ComponentLocator <IVocabulary> .ImportMany(); } return(_vocabularies.Select(v => v.Value)); }
private void FormatItem(int start) { IEnumerable <Lazy <IEditorFormatter> > providers = ComponentLocator <IEditorFormatter> .ImportMany(); foreach (var locator in providers) { Span span = new Span(start, 1); locator.Value.FormatRange(_view, _view.TextBuffer, span); break; } }
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); }
private static IEnumerable <Lazy <IRCompletionListProvider> > GetCompletionProviders(ICoreShell shell) => ComponentLocator <IRCompletionListProvider> .ImportMany(shell.CompositionService);
private static IEnumerable <Lazy <IRCompletionListProvider> > GetCompletionProviders(ICoreShell shell) { var cs = shell.GetService <ICompositionService>(); return(ComponentLocator <IRCompletionListProvider> .ImportMany(cs)); }