コード例 #1
0
 internal override IChainedCommandHandler <AutomaticLineEnderCommandArgs> CreateCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations,
     IAsyncCompletionBroker asyncCompletionBroker)
 {
     return(new AutomaticLineEnderCommandHandler(undoRegistry, editorOperations, asyncCompletionBroker));
 }
コード例 #2
0
        internal VimWordCompletionUtil(
            Lazy <IVimHost> vimHost,
            IAsyncCompletionBroker asyncCompletionBroker,
            ICompletionBroker completionBroker,
#if VS_SPECIFIC_2019
            IIntellisenseSessionStackMapService intellisenseSessionStackMapService,
            [Import(AllowDefault = true)] IVsEditorAdaptersFactoryService vsEditorAdapterFactoryService = null)
コード例 #3
0
ファイル: AsyncCompletionSource.cs プロジェクト: int19h/PTVS
        public AsyncCompletionSource(
            ITextView textView,
            ITextStructureNavigatorSelectorService navigatorService,
            IAsyncCompletionBroker editorCompletionBroker,
            PythonLanguageClient languageClient)
        {
            Requires.NotNull(textView, nameof(textView));
            Requires.NotNull(navigatorService, nameof(navigatorService));

            this.textView = textView;
            this.editorCompletionBroker = editorCompletionBroker;
            this.navigatorService       = navigatorService;
            this.languageClient         = languageClient;

            Requires.NotNull(this.navigatorService, nameof(this.navigatorService));

            // Cancel requests which are no longer needed and send telemetry
            this.textView.Closed += this.OnTextViewClosed;

            // Trigger characters actually come from Pylance but we know what they are.
            this.triggerCharacters = new char[] { '.', '[' };

            // Pylance does not support commit characters
            this.serverCommitCharacters = new char[] { }.ToImmutableHashSet();
        }
コード例 #4
0
 public AutomaticLineEnderCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations,
     IAsyncCompletionBroker asyncCompletionBroker)
     : base(undoRegistry, editorOperations, asyncCompletionBroker)
 {
 }
        public RazorDirectiveAttributeCompletionSourceProvider(
            ForegroundDispatcher foregroundDispatcher,
            RazorCompletionFactsService completionFactsService,
            IAsyncCompletionBroker asyncCoompletionBroker,
            ICompletionBroker completionBroker,
            VisualStudioDescriptionFactory descriptionFactory)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (completionFactsService == null)
            {
                throw new ArgumentNullException(nameof(completionFactsService));
            }

            if (asyncCoompletionBroker is null)
            {
                throw new ArgumentNullException(nameof(asyncCoompletionBroker));
            }

            if (descriptionFactory == null)
            {
                throw new ArgumentNullException(nameof(descriptionFactory));
            }

            _foregroundDispatcher   = foregroundDispatcher;
            _completionFactsService = completionFactsService;
            _completionBroker       = completionBroker;
            _descriptionFactory     = descriptionFactory;
        }
コード例 #6
0
        public RazorDirectiveCompletionProvider(
            [Import(typeof(RazorCodeDocumentProvider))] Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
            [Import(typeof(RazorCompletionFactsService))] Lazy <RazorCompletionFactsService> completionFactsService,
            IAsyncCompletionBroker asyncCompletionBroker,
            RazorTextBufferProvider textBufferProvider)
        {
            if (codeDocumentProvider == null)
            {
                throw new ArgumentNullException(nameof(codeDocumentProvider));
            }

            if (completionFactsService == null)
            {
                throw new ArgumentNullException(nameof(completionFactsService));
            }

            if (asyncCompletionBroker == null)
            {
                throw new ArgumentNullException(nameof(asyncCompletionBroker));
            }

            if (textBufferProvider == null)
            {
                throw new ArgumentNullException(nameof(textBufferProvider));
            }

            _codeDocumentProvider   = codeDocumentProvider;
            _completionFactsService = completionFactsService;
            _asyncCompletionBroker  = asyncCompletionBroker;
            _textBufferProvider     = textBufferProvider;
        }
コード例 #7
0
 internal WordAsyncCompletionSessionFactory(
     IAsyncCompletionBroker asyncCompletionBroker,
     IVsEditorAdaptersFactoryService vsEditorAdaptersFactoryService = null)
 {
     _asyncCompletionBroker          = asyncCompletionBroker;
     _vsEditorAdaptersFactoryService = vsEditorAdaptersFactoryService;
 }
コード例 #8
0
 public AbstractAutomaticLineEnderCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IAsyncCompletionBroker asyncCompletionBroker)
 {
     _undoRegistry = undoRegistry;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _asyncCompletionBroker          = asyncCompletionBroker;
 }
コード例 #9
0
 public FailOnGetCompletionsProvider(
     Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
     IAsyncCompletionBroker asyncCompletionBroker,
     RazorTextBufferProvider textBufferProvider,
     bool canGetSnapshotPoint = true)
     : base(codeDocumentProvider, new Lazy <RazorCompletionFactsService>(() => new DefaultRazorCompletionFactsService()), asyncCompletionBroker, textBufferProvider)
 {
     _canGetSnapshotPoint = canGetSnapshotPoint;
 }
コード例 #10
0
 public AsyncCompletionTracker(
     IAsynchronousOperationListenerProvider asynchronousOperationListenerProvider,
     IAsyncCompletionBroker asyncCompletionBroker)
 {
     // Store the listener provider, but delay accessing the listener itself since tracking could still be
     // disabled during the initialization sequence for integration tests.
     _asynchronousOperationListenerProvider = asynchronousOperationListenerProvider;
     _asyncCompletionBroker = asyncCompletionBroker;
 }
コード例 #11
0
 public SignatureHelpBeforeCompletionCommandHandler(
     IThreadingContext threadingContext,
     [ImportMany] IEnumerable <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > signatureHelpProviders,
     [ImportMany] IEnumerable <Lazy <IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession>, OrderableMetadata> > signatureHelpPresenters,
     IAsyncCompletionBroker completionBroker,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, signatureHelpProviders, signatureHelpPresenters, completionBroker, listenerProvider)
 {
 }
コード例 #12
0
 internal VimWordCompletionUtil(
     Lazy <IVimHost> vimHost,
     IAsyncCompletionBroker asyncCompletionBroker,
     ICompletionBroker completionBroker,
     IIntellisenseSessionStackMapService intellisenseSessionStackMapService,
     [Import(AllowDefault = true)] IVsEditorAdaptersFactoryService vsEditorAdapterFactoryService = null)
     : base(vimHost)
 {
     _asyncCompletionBroker = asyncCompletionBroker;
     _asyncFactory          = new WordAsyncCompletionSessionFactory(asyncCompletionBroker, vsEditorAdapterFactoryService);
     _legacyFactory         = new WordLegacyCompletionSessionFactory(completionBroker, intellisenseSessionStackMapService);
 }
コード例 #13
0
 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;
 }
コード例 #14
0
ファイル: Controller.cs プロジェクト: zsr2531/roslyn
 // 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;
 }
コード例 #15
0
ファイル: Controller.cs プロジェクト: zsr2531/roslyn
 public Controller(
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IDocumentProvider documentProvider,
     IList <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > allProviders,
     IAsyncCompletionBroker completionBroker)
     : base(threadingContext, textView, subjectBuffer, presenter, asyncListener, documentProvider, "SignatureHelp")
 {
     _completionBroker = completionBroker;
     _allProviders     = allProviders;
 }
コード例 #16
0
        public DefaultCompletionProviderDependencies(
            RazorCompletionFactsService completionFactsService,
            IAsyncCompletionBroker asyncCompletionBroker)
        {
            if (completionFactsService == null)
            {
                throw new ArgumentNullException(nameof(completionFactsService));
            }

            if (asyncCompletionBroker == null)
            {
                throw new ArgumentNullException(nameof(asyncCompletionBroker));
            }

            CompletionFactsService = completionFactsService;
            AsyncCompletionBroker  = asyncCompletionBroker;
        }
コード例 #17
0
ファイル: Controller.cs プロジェクト: zsr2531/roslyn
        internal static Controller GetInstance(
            IThreadingContext threadingContext,
            EditorCommandArgs args,
            IIntelliSensePresenter <ISignatureHelpPresenterSession, ISignatureHelpSession> presenter,
            IAsynchronousOperationListener asyncListener,
            IList <Lazy <ISignatureHelpProvider, OrderableLanguageMetadata> > allProviders,
            IAsyncCompletionBroker completionBroker)
        {
            var textView      = args.TextView;
            var subjectBuffer = args.SubjectBuffer;

            return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_controllerPropertyKey,
                                                                (v, b) => new Controller(threadingContext, v, b,
                                                                                         presenter,
                                                                                         asyncListener,
                                                                                         new DocumentProvider(threadingContext),
                                                                                         allProviders, completionBroker)));
        }
コード例 #18
0
        public RazorDirectiveAttributeCompletionSourceProvider(
            ProjectSnapshotManagerDispatcher projectSnapshotManagerDispatcher,
            RazorCompletionFactsService completionFactsService,
            IAsyncCompletionBroker asyncCoompletionBroker,
            ICompletionBroker completionBroker,
            VisualStudioDescriptionFactory descriptionFactory,
            JoinableTaskContext joinableTaskContext)
        {
            if (projectSnapshotManagerDispatcher == null)
            {
                throw new ArgumentNullException(nameof(projectSnapshotManagerDispatcher));
            }

            if (completionFactsService == null)
            {
                throw new ArgumentNullException(nameof(completionFactsService));
            }

            if (asyncCoompletionBroker is null)
            {
                throw new ArgumentNullException(nameof(asyncCoompletionBroker));
            }

            if (descriptionFactory == null)
            {
                throw new ArgumentNullException(nameof(descriptionFactory));
            }

            if (joinableTaskContext is null)
            {
                throw new ArgumentNullException(nameof(joinableTaskContext));
            }

            _projectSnapshotManagerDispatcher = projectSnapshotManagerDispatcher;
            _completionFactsService           = completionFactsService;
            _completionBroker    = completionBroker;
            _descriptionFactory  = descriptionFactory;
            _joinableTaskContext = joinableTaskContext;
        }
コード例 #19
0
        public DefaultLSPEditorService(
            JoinableTaskContext joinableTaskContext,
            SVsServiceProvider serviceProvider,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IAsyncCompletionBroker completionBroker,
            IVsEditorAdaptersFactoryService adaptersFactoryService)
        {
            if (joinableTaskContext is null)
            {
                throw new ArgumentNullException(nameof(joinableTaskContext));
            }

            if (serviceProvider is null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            if (undoManagerProvider is null)
            {
                throw new ArgumentNullException(nameof(undoManagerProvider));
            }

            if (completionBroker is null)
            {
                throw new ArgumentNullException(nameof(completionBroker));
            }

            if (adaptersFactoryService is null)
            {
                throw new ArgumentNullException(nameof(adaptersFactoryService));
            }

            _joinableTaskFactory    = joinableTaskContext.Factory;
            _serviceProvider        = serviceProvider;
            _undoManagerProvider    = undoManagerProvider;
            _completionBroker       = completionBroker;
            _adaptersFactoryService = adaptersFactoryService;
        }
コード例 #20
0
 internal WordAsyncCompletionSessionFactory(
     IAsyncCompletionBroker asyncCompletionBroker)
 {
     _asyncCompletionBroker = asyncCompletionBroker;
 }
コード例 #21
0
 internal abstract IChainedCommandHandler <AutomaticLineEnderCommandArgs> CreateCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations,
     IAsyncCompletionBroker asyncCompletionBroker);