Пример #1
0
        protected AbstractController(
            IGlobalOptionService globalOptions,
            IThreadingContext threadingContext,
            ITextView textView,
            ITextBuffer subjectBuffer,
            IIntelliSensePresenter <TPresenterSession, TEditorSession> presenter,
            IAsynchronousOperationListener asyncListener,
            IDocumentProvider documentProvider,
            string asyncOperationId)
            : base(threadingContext)
        {
            this.GlobalOptions    = globalOptions;
            this.TextView         = textView;
            this.SubjectBuffer    = subjectBuffer;
            this.Presenter        = presenter;
            _asyncListener        = asyncListener;
            this.DocumentProvider = documentProvider;
            _asyncOperationId     = asyncOperationId;

            this.TextView.Closed += OnTextViewClosed;

            // Caret position changed only fires if the caret is explicitly moved.  It doesn't fire
            // when the caret is moved because of text change events.
            this.TextView.Caret.PositionChanged  += this.OnCaretPositionChanged;
            this.TextView.TextBuffer.PostChanged += this.OnTextViewBufferPostChanged;
        }
Пример #2
0
 public SignatureHelpCommandHandler(
     [ImportMany] IEnumerable <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > signatureHelpProviders,
     [ImportMany] IEnumerable <Lazy <IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession>, OrderableMetadata> > signatureHelpPresenters,
     IAsynchronousOperationListenerProvider listenerProvider)
 {
     _signatureHelpProviders = ExtensionOrderer.Order(signatureHelpProviders);
     _listener = listenerProvider.GetListener(FeatureAttribute.SignatureHelp);
     _signatureHelpPresenter = ExtensionOrderer.Order(signatureHelpPresenters).Select(lazy => lazy.Value).FirstOrDefault();
 }
Пример #3
0
 // For testing purposes.
 public SignatureHelpCommandHandler(
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> signatureHelpPresenter,
     [ImportMany] IEnumerable <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > signatureHelpProviders,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
 {
     _signatureHelpProviders = ExtensionOrderer.Order(signatureHelpProviders);
     _asyncListeners         = asyncListeners;
     _signatureHelpPresenter = signatureHelpPresenter;
 }
 // For testing purposes.
 public QuickInfoCommandHandlerAndSourceProvider(
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     [ImportMany] IEnumerable <Lazy <IQuickInfoProvider, OrderableLanguageMetadata> > providers,
     IAsynchronousOperationListenerProvider listenerProvider)
 {
     _providers = ExtensionOrderer.Order(providers);
     _listener  = listenerProvider.GetListener(FeatureAttribute.QuickInfo);
     _presenter = presenter;
 }
Пример #5
0
 // For testing purposes.
 public SignatureHelpCommandHandler(
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> signatureHelpPresenter,
     [ImportMany] IEnumerable <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > signatureHelpProviders,
     IAsynchronousOperationListenerProvider listenerProvider)
 {
     _signatureHelpProviders = ExtensionOrderer.Order(signatureHelpProviders);
     _listener = listenerProvider.GetListener(FeatureAttribute.SignatureHelp);
     _signatureHelpPresenter = signatureHelpPresenter;
 }
Пример #6
0
 // For testing purposes.
 public QuickInfoCommandHandlerAndSourceProvider(
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     [ImportMany] IEnumerable <Lazy <IQuickInfoProvider, OrderableLanguageMetadata> > providers,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
 {
     _providers      = ExtensionOrderer.Order(providers);
     _asyncListeners = asyncListeners;
     _presenter      = presenter;
 }
Пример #7
0
 public Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IQuickInfoProviderCoordinatorFactory providerCoordinatorFactory)
     : base(textView, subjectBuffer, presenter, asyncListener, documentProvider, "QuickInfo")
 {
     _providerCoordinatorFactory = providerCoordinatorFactory;
 }
 public QuickInfoCommandHandlerAndSourceProvider(
     IThreadingContext threadingContext,
     [ImportMany] IEnumerable <Lazy <IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession>, OrderableMetadata> > presenters,
     [ImportMany] IEnumerable <Lazy <IQuickInfoProvider, OrderableLanguageMetadata> > providers,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext)
 {
     _providers = ExtensionOrderer.Order(providers);
     _listener  = listenerProvider.GetListener(FeatureAttribute.QuickInfo);
     _presenter = ExtensionOrderer.Order(presenters).Select(lazy => lazy.Value).FirstOrDefault();
 }
 // For testing purposes.
 public QuickInfoCommandHandlerAndSourceProvider(
     //IInlineRenameService inlineRenameService,
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     IQuickInfoProviderCoordinatorFactory providerCoordinatorFactory,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
 {
     //_inlineRenameService = inlineRenameService;
     _providerCoordinatorFactory = providerCoordinatorFactory;
     _asyncListeners             = asyncListeners;
     _presenter = presenter;
 }
Пример #10
0
 // For testing purposes.
 internal Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <ISignatureHelpProvider> providers)
     : base(textView, subjectBuffer, presenter, asyncListener, documentProvider, "SignatureHelp")
 {
     _providers = providers;
 }
Пример #11
0
 public Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > allProviders)
     : base(textView, subjectBuffer, presenter, asyncListener, documentProvider, "SignatureHelp")
 {
     _allProviders = allProviders;
 }
Пример #12
0
 // For testing purposes
 internal Controller(
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <IQuickInfoProvider> providers)
     : base(threadingContext, textView, subjectBuffer, presenter, asyncListener, documentProvider, "QuickInfo")
 {
     _providers = providers;
 }
Пример #13
0
 public Controller(
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <Lazy <IQuickInfoProvider, OrderableLanguageMetadata> > allProviders)
     : base(threadingContext, textView, subjectBuffer, presenter, asyncListener, documentProvider, "QuickInfo")
 {
     _allProviders = allProviders;
 }
 public AbstractSignatureHelpCommandHandler(
     IThreadingContext threadingContext,
     IEnumerable <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > signatureHelpProviders,
     IEnumerable <Lazy <IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession>, OrderableMetadata> > signatureHelpPresenters,
     IAsyncCompletionBroker completionBroker,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext)
 {
     _signatureHelpProviders = ExtensionOrderer.Order(signatureHelpProviders);
     _listener = listenerProvider.GetListener(FeatureAttribute.SignatureHelp);
     _signatureHelpPresenter = ExtensionOrderer.Order(signatureHelpPresenters).Select(lazy => lazy.Value).FirstOrDefault();
     _completionBroker       = completionBroker;
 }
Пример #15
0
 internal static Controller GetInstance(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
     IAsynchronousOperationListener asyncListener,
     ImmutableHashSet <char> autoBraceCompletionChars)
 {
     return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_controllerPropertyKey,
                                                         (v, b) => new Controller(
                                                             textView, subjectBuffer, editorOperationsFactoryService, undoHistoryRegistry,
                                                             presenter, asyncListener, autoBraceCompletionChars, false, false)));
 }
 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> completionPresenter,
     IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners,
     IEnumerable <Lazy <IBraceCompletionSessionProvider, BraceCompletionMetadata> > autoBraceCompletionChars)
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry            = undoHistoryRegistry;
     _completionPresenter            = completionPresenter;
     _asyncListeners             = asyncListeners;
     _autoBraceCompletionChars   = autoBraceCompletionChars;
     _autoBraceCompletionCharSet = new Dictionary <IContentType, ImmutableHashSet <char> >();
 }
Пример #17
0
 // For testing purposes.
 internal Controller(
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <ISignatureHelpProvider> providers,
     IAsyncCompletionBroker completionBroker)
     : base(threadingContext, textView, subjectBuffer, presenter, asyncListener, documentProvider, "SignatureHelp")
 {
     _providers        = providers.ToImmutableArray();
     _completionBroker = completionBroker;
 }
Пример #18
0
 public Controller(
     IGlobalOptionService globalOptions,
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > allProviders,
     IAsyncCompletionBroker completionBroker)
     : base(globalOptions, threadingContext, textView, subjectBuffer, presenter, asyncListener, documentProvider, "SignatureHelp")
 {
     _completionBroker = completionBroker;
     _allProviders     = allProviders;
 }
Пример #19
0
 internal static Controller GetInstance(
     EditorCommandArgs args,
     IIntelliSensePresenter<ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IList<Lazy<ISignatureHelpProvider, OrderableLanguageMetadata>> allProviders)
 {
     var textView = args.TextView;
     var subjectBuffer = args.SubjectBuffer;
     return textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_controllerPropertyKey,
         (v, b) => new Controller(v, b,
             presenter,
             asyncListener,
             new DocumentProvider(),
             allProviders));
 }
Пример #20
0
        internal static Controller GetInstance(
            CommandArgs args,
            IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
            IAsynchronousOperationListener asyncListener,
            IQuickInfoProviderCoordinatorFactory providerCoordinatorFactory)
        {
            var textView      = args.TextView;
            var subjectBuffer = args.SubjectBuffer;

            return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_quickInfoPropertyKey,
                                                                (v, b) => new Controller(v, b,
                                                                                         presenter,
                                                                                         asyncListener,
                                                                                         new DocumentProvider(),
                                                                                         providerCoordinatorFactory)));
        }
Пример #21
0
        internal static Controller GetInstance(
            IThreadingContext threadingContext,
            EditorCommandArgs args,
            IIntelliSensePresenter <IQuickInfoPresenterSession, IQuickInfoSession> presenter,
            IAsynchronousOperationListener asyncListener,
            IList <Lazy <IQuickInfoProvider, OrderableLanguageMetadata> > allProviders)
        {
            var textView      = args.TextView;
            var subjectBuffer = args.SubjectBuffer;

            return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_quickInfoPropertyKey,
                                                                (v, b) => new Controller(threadingContext, v, b,
                                                                                         presenter,
                                                                                         asyncListener,
                                                                                         new DocumentProvider(threadingContext),
                                                                                         allProviders)));
        }
Пример #22
0
        public AsyncCompletionService(
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IInlineRenameService inlineRenameService,
            IAsynchronousOperationListenerProvider listenerProvider,
            [ImportMany] IEnumerable <Lazy <IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession>, OrderableMetadata> > completionPresenters,
            [ImportMany] IEnumerable <Lazy <IBraceCompletionSessionProvider, BraceCompletionMetadata> > autoBraceCompletionChars)
        {
            _editorOperationsFactoryService = editorOperationsFactoryService;
            _undoHistoryRegistry            = undoHistoryRegistry;
            _inlineRenameService            = inlineRenameService;
            _completionPresenter            = ExtensionOrderer.Order(completionPresenters).Select(lazy => lazy.Value).FirstOrDefault();
            _listener = listenerProvider.GetListener(FeatureAttribute.CompletionSet);

            _autoBraceCompletionChars   = autoBraceCompletionChars;
            _autoBraceCompletionCharSet = new Dictionary <IContentType, ImmutableHashSet <char> >();
        }
Пример #23
0
        internal static Controller GetInstance(
            ITextView textView,
            ITextBuffer subjectBuffer,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
            IAsynchronousOperationListener asyncListener,
            ImmutableHashSet <char> autoBraceCompletionChars)
        {
            var debuggerTextView  = textView as IDebuggerTextView;
            var isDebugger        = debuggerTextView != null;
            var isImmediateWindow = isDebugger && debuggerTextView.IsImmediateWindow;

            return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_controllerPropertyKey,
                                                                (v, b) => new Controller(
                                                                    textView, subjectBuffer, editorOperationsFactoryService, undoHistoryRegistry,
                                                                    presenter, asyncListener, autoBraceCompletionChars, isDebugger, isImmediateWindow)));
        }
Пример #24
0
 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IInlineRenameService inlineRenameService,
     IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession> completionPresenter,
     IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
     IEnumerable<Lazy<ICompletionProvider, OrderableLanguageMetadata>> allCompletionProviders,
     IEnumerable<Lazy<IBraceCompletionSessionProvider, IBraceCompletionMetadata>> autoBraceCompletionChars)
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry = undoHistoryRegistry;
     _inlineRenameService = inlineRenameService;
     _completionPresenter = completionPresenter;
     _asyncListeners = asyncListeners;
     _allCompletionProviders = ExtensionOrderer.Order(allCompletionProviders);
     _autoBraceCompletionChars = autoBraceCompletionChars;
     _autoBraceCompletionCharSet = new Dictionary<IContentType, ImmutableHashSet<char>>();
 }
Пример #25
0
 public Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
     IAsynchronousOperationListener asyncListener,
     ImmutableHashSet <char> autoBraceCompletionChars,
     bool isDebugger,
     bool isImmediateWindow)
     : base(textView, subjectBuffer, presenter, asyncListener, null, "Completion")
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry            = undoHistoryRegistry;
     _autoBraceCompletionChars       = autoBraceCompletionChars;
     _isDebugger        = isDebugger;
     _isImmediateWindow = isImmediateWindow;
     _roles             = textView.Roles.ToImmutableHashSet();
 }
Пример #26
0
 public Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IEnumerable <Lazy <CompletionListProvider, OrderableLanguageMetadata> > allCompletionProviders,
     ImmutableHashSet <char> autoBraceCompletionChars,
     bool isDebugger,
     bool isImmediateWindow)
     : base(textView, subjectBuffer, presenter, asyncListener, null, "Completion")
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry            = undoHistoryRegistry;
     _allCompletionProviders         = allCompletionProviders;
     _autoBraceCompletionChars       = autoBraceCompletionChars;
     _isDebugger        = isDebugger;
     _isImmediateWindow = isImmediateWindow;
 }