コード例 #1
0
        public static IEnumerable <IVocabulary> GetAllVocabularies()
        {
            if (_vocabularies == null)
            {
                _vocabularies = ComponentLocator <IVocabulary> .ImportMany();
            }

            return(_vocabularies.Select(v => v.Value));
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
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);
        }
コード例 #5
0
 private static IEnumerable <Lazy <IRCompletionListProvider> > GetCompletionProviders(ICoreShell shell) => ComponentLocator <IRCompletionListProvider> .ImportMany(shell.CompositionService);
コード例 #6
0
ファイル: RCompletionEngine.cs プロジェクト: jingmouren/RTVS
        private static IEnumerable <Lazy <IRCompletionListProvider> > GetCompletionProviders(ICoreShell shell)
        {
            var cs = shell.GetService <ICompositionService>();

            return(ComponentLocator <IRCompletionListProvider> .ImportMany(cs));
        }