public SuggestedActionsSourceProvider(
            IThreadingContext threadingContext,
            ICodeRefactoringService codeRefactoringService,
            IDiagnosticAnalyzerService diagnosticService,
            ICodeFixService codeFixService,
            ICodeActionEditHandlerService editHandler,
            IWaitIndicator waitIndicator,
            ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry,
            IAsynchronousOperationListenerProvider listenerProvider,
            [ImportMany]
            IEnumerable <Lazy <IImageMonikerService, OrderableMetadata> > imageMonikerServices,
            [ImportMany] IEnumerable <Lazy <ISuggestedActionCallback> > actionCallbacks
            )
        {
            _threadingContext                = threadingContext;
            _codeRefactoringService          = codeRefactoringService;
            _diagnosticService               = diagnosticService;
            _codeFixService                  = codeFixService;
            _suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
            ActionCallbacks                  = actionCallbacks.ToImmutableArray();
            EditHandler       = editHandler;
            WaitIndicator     = waitIndicator;
            OperationListener = listenerProvider.GetListener(FeatureAttribute.LightBulb);

            ImageMonikerServices = ExtensionOrderer.Order(imageMonikerServices).ToImmutableArray();
        }
Exemplo n.º 2
0
            public SuggestedActionsSource(
                IThreadingContext threadingContext,
                SuggestedActionsSourceProvider owner,
                ITextView textView,
                ITextBuffer textBuffer,
                ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry)
                : base(threadingContext)
            {
                _owner            = owner;
                _textView         = textView;
                _textView.Closed += OnTextViewClosed;
                _subjectBuffer    = textBuffer;
                _suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
                _registration = Workspace.GetWorkspaceRegistration(textBuffer.AsTextContainer());

                _lastSolutionVersionReported = InvalidSolutionVersion;
                var updateSource = (IDiagnosticUpdateSource)_owner._diagnosticService;

                updateSource.DiagnosticsUpdated += OnDiagnosticsUpdated;

                if (_registration.Workspace != null)
                {
                    _workspace = _registration.Workspace;
                    _workspace.DocumentActiveContextChanged += OnActiveContextChanged;
                }

                _registration.WorkspaceChanged += OnWorkspaceChanged;
            }
        public SuggestedActionsSource(IViewTagAggregatorFactoryService tagService, ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry, ITextView view, ITextBuffer textBuffer, string file)
        {
            this.tagService = tagService;
            this.suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
            this.view = view;
            this.file = file;

            RapidXamlDocumentCache.Add(this.file, textBuffer.CurrentSnapshot);
        }
 public AsyncSuggestedActionsSource(
     IThreadingContext threadingContext,
     SuggestedActionsSourceProvider owner,
     ITextView textView,
     ITextBuffer textBuffer,
     ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry)
     : base(threadingContext, owner, textView, textBuffer, suggestedActionCategoryRegistry)
 {
 }
Exemplo n.º 5
0
		public Dev14KeyProcessor(IWpfTextView wpfTextView, ILightBulbBroker lightBulbBroker, ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistryService, ISmartTagBroker smartTagBroker, IPeekBroker peekBroker) {
			this.wpfTextView = wpfTextView;
			this.lightBulbBroker = lightBulbBroker;
			this.suggestedActionCategoryRegistryService = suggestedActionCategoryRegistryService;
			this.smartTagBroker = smartTagBroker;
			this.peekBroker = peekBroker;

			AddShortcuts();
		}
Exemplo n.º 6
0
        public Dev14KeyProcessor(IWpfTextView wpfTextView, ILightBulbBroker lightBulbBroker, ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistryService, ISmartTagBroker smartTagBroker, IPeekBroker peekBroker)
        {
            this.wpfTextView     = wpfTextView;
            this.lightBulbBroker = lightBulbBroker;
            this.suggestedActionCategoryRegistryService = suggestedActionCategoryRegistryService;
            this.smartTagBroker = smartTagBroker;
            this.peekBroker     = peekBroker;

            AddShortcuts();
        }
Exemplo n.º 7
0
        public SuggestedActionsSource(IViewTagAggregatorFactoryService tagService, ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry, ITextView view, ITextBuffer textBuffer, string file)
        {
            this.tagService = tagService;
            this.suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
            this.view = view;
            this.file = file;

            // Don't want every change event as that is a lot during editing. Wait for a second of inactivity before reparsing.
            this.WhenViewLayoutChanged.Throttle(TimeSpan.FromSeconds(1)).Subscribe(e => this.OnViewLayoutChanged(this, e));

            RapidXamlDocumentCache.Add(this.file, textBuffer.CurrentSnapshot);
        }
Exemplo n.º 8
0
            protected SuggestedActionsSource(
                IThreadingContext threadingContext,
                IGlobalOptionService globalOptions,
                SuggestedActionsSourceProvider owner,
                ITextView textView,
                ITextBuffer textBuffer,
                ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry)
                : base(threadingContext)
            {
                GlobalOptions = globalOptions;

                _suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
                _state = new ReferenceCountedDisposable <State>(new State(this, owner, textView, textBuffer));

                _state.Target.TextView.Closed += OnTextViewClosed;
            }
            protected SuggestedActionsSource(
                IThreadingContext threadingContext,
                SuggestedActionsSourceProvider owner,
                ITextView textView,
                ITextBuffer textBuffer,
                ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry)
                : base(threadingContext)
            {
                _suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
                _state = new ReferenceCountedDisposable <State>(new State(this, owner, textView, textBuffer));

                _state.Target.TextView.Closed += OnTextViewClosed;

                var updateSource = (IDiagnosticUpdateSource)owner._diagnosticService;

                updateSource.DiagnosticsUpdated += OnDiagnosticsUpdated;

                RegisterEventsToWorkspace(_state, _state.Target.Registration.Workspace);

                _state.Target.Registration.WorkspaceChanged += OnWorkspaceChanged;
            }
        public SuggestedActionsSourceProvider(
            IThreadingContext threadingContext,
            ICodeRefactoringService codeRefactoringService,
            ICodeFixService codeFixService,
            ICodeActionEditHandlerService editHandler,
            IUIThreadOperationExecutor uiThreadOperationExecutor,
            ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry,
            IAsynchronousOperationListenerProvider listenerProvider,
            IGlobalOptionService globalOptions,
            [ImportMany] IEnumerable <Lazy <IImageIdService, OrderableMetadata> > imageIdServices)
        {
            _threadingContext                = threadingContext;
            _codeRefactoringService          = codeRefactoringService;
            _codeFixService                  = codeFixService;
            _suggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
            _globalOptions            = globalOptions;
            EditHandler               = editHandler;
            UIThreadOperationExecutor = uiThreadOperationExecutor;
            OperationListener         = listenerProvider.GetListener(FeatureAttribute.LightBulb);

            ImageIdServices = ExtensionOrderer.Order(imageIdServices).ToImmutableArray();
        }
 public SuggestedActionsSourceProvider(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, ITextDocumentFactoryService textDocumentFactoryService, ISuggestedActionCategoryRegistryService suggestedActionCategoryRegistry)
 {
     this.ViewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
     this.TextDocumentFactoryService      = textDocumentFactoryService;
     this.SuggestedActionCategoryRegistry = suggestedActionCategoryRegistry;
 }