public CSharpRenameTrackingCodeFixProvider(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     [ImportMany] IEnumerable<IRefactorNotifyService> refactorNotifyServices)
     : base(waitIndicator, undoHistoryRegistry, refactorNotifyServices)
 {
 }
 public InteractiveWindowProvider(
     IContentTypeRegistryService contentTypeRegistry,
     ITextBufferFactoryService bufferFactory,
     IProjectionBufferFactoryService projectionBufferFactory,
     IEditorOperationsFactoryService editorOperationsFactory,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextEditorFactoryService editorFactory,
     IRtfBuilderService rtfBuilderService,
     IIntellisenseSessionStackMapService intellisenseSessionStackMap,
     ISmartIndentationService smartIndenterService,
     IInteractiveWindowEditorFactoryService windowFactoryService,
     IWaitIndicator waitIndicator)
 {
     _contentTypeRegistry = contentTypeRegistry;
     _bufferFactory = bufferFactory;
     _projectionBufferFactory = projectionBufferFactory;
     _editorOperationsFactory = editorOperationsFactory;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _editorFactory = editorFactory;
     _rtfBuilderService = rtfBuilderService;
     _intellisenseSessionStackMap = intellisenseSessionStackMap;
     _smartIndenterService = smartIndenterService;
     _windowFactoryService = windowFactoryService;
     _waitIndicator = waitIndicator;
 }
 internal TextStructureNavigatorProvider(
     ITextStructureNavigatorSelectorService selectorService,
     IContentTypeRegistryService contentTypeService,
     IWaitIndicator waitIndicator)
     : base(selectorService, contentTypeService, waitIndicator)
 {
 }
 public NavigationBarControllerFactoryService(
     IWaitIndicator waitIndicator,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
 {
     _waitIndicator = waitIndicator;
     _asyncListener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.NavigationBar);
 }
        public NavigationBarController(
            INavigationBarPresenter presenter,
            ITextBuffer subjectBuffer,
            IWaitIndicator waitIndicator,
            IAsynchronousOperationListener asyncListener)
        {
            _presenter = presenter;
            _subjectBuffer = subjectBuffer;
            _waitIndicator = waitIndicator;
            _asyncListener = asyncListener;
            _workspaceRegistration = Workspace.GetWorkspaceRegistration(subjectBuffer.AsTextContainer());
            _workspaceRegistration.WorkspaceChanged += OnWorkspaceRegistrationChanged;

            presenter.CaretMoved += OnCaretMoved;
            presenter.ViewFocused += OnViewFocused;

            presenter.DropDownFocused += OnDropDownFocused;
            presenter.ItemSelected += OnItemSelected;

            subjectBuffer.PostChanged += OnSubjectBufferPostChanged;

            // Initialize the tasks to be an empty model so we never have to deal with a null case.
            _modelTask = Task.FromResult(
                new NavigationBarModel(
                    SpecializedCollections.EmptyList<NavigationBarItem>(),
                    default(VersionStamp),
                    null));

            _selectedItemInfoTask = Task.FromResult(new NavigationBarSelectedTypeAndMember(null, null));

            if (_workspaceRegistration.Workspace != null)
            {
                ConnectToWorkspace(_workspaceRegistration.Workspace);
            }
        }
 public FixMultipleOccurrencesService(
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator)
 {
     _editHandler = editHandler;
     _waitIndicator = waitIndicator;
 }
 public AutomaticLineEnderCommandHandler(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations)
     : base(waitIndicator, undoRegistry, editorOperations)
 {
 }
 public ExtractMethodCommandHandler(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IInlineRenameService renameService,
     IWaitIndicator waitIndicator) :
     base(undoManager, editorOperationsFactoryService, renameService, waitIndicator)
 {
 }
 public SuggestedActionWithPreview(
     Workspace workspace, ITextBuffer subjectBuffer, ICodeActionEditHandlerService editHandler, 
     IWaitIndicator waitIndicator, CodeAction codeAction, object provider, 
     IAsynchronousOperationListener operationListener) 
     : base(workspace, subjectBuffer, editHandler, waitIndicator, codeAction,
           provider, operationListener, actionSets: null)
 {
 }
Example #10
0
 public RenameCommandHandler(
     InlineRenameService renameService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
 {
     _renameService = renameService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _waitIndicator = waitIndicator;
 }
 protected SuggestedActionWithFlavors(
     Workspace workspace,
     ITextBuffer subjectBuffer,
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator,
     CodeAction codeAction,
     object provider) : base(workspace, subjectBuffer, editHandler, waitIndicator, codeAction, provider)
 {
 }
 protected AbstractRenameTrackingCodeFixProvider(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEnumerable<IRefactorNotifyService> refactorNotifyServices)
 {
     _waitIndicator = waitIndicator;
     _undoHistoryRegistry = undoHistoryRegistry;
     _refactorNotifyServices = refactorNotifyServices;
 }
 public FixMultipleOccurrencesService(
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
 {
     _editHandler = editHandler;
     _waitIndicator = waitIndicator;
     _listener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.LightBulb);
 }
        protected AbstractEditorFactory(Package package)
        {
            _package = package ?? throw new ArgumentNullException(nameof(package));
            _componentModel = (IComponentModel)ServiceProvider.GetService(typeof(SComponentModel));

            _editorAdaptersFactoryService = _componentModel.GetService<IVsEditorAdaptersFactoryService>();
            _contentTypeRegistryService = _componentModel.GetService<IContentTypeRegistryService>();
            _waitIndicator = _componentModel.GetService<IWaitIndicator>();
        }
 public CodeRefactoringSuggestedAction(
     Workspace workspace,
     ITextBuffer subjectBuffer,
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator,
     CodeAction codeAction,
     CodeRefactoringProvider provider)
     : base(workspace, subjectBuffer, editHandler, waitIndicator, codeAction, provider)
 {
 }
 internal PreviewChangesSuggestedAction(
     Workspace workspace,
     ITextBuffer subjectBuffer,
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator,
     PreviewChangesCodeAction codeAction,
     object provider)
     : base(workspace, subjectBuffer, editHandler, waitIndicator, codeAction, provider)
 {
 }
 public PeekableItemSourceProvider(
     IPeekableItemFactory peekableItemFactory,
     IPeekResultFactory peekResultFactory,
     IMetadataAsSourceFileService metadataAsSourceService,
     IWaitIndicator waitIndicator)
 {
     _peekableItemFactory = peekableItemFactory;
     _peekResultFactory = peekResultFactory;
     _metadataAsSourceService = metadataAsSourceService;
     _waitIndicator = waitIndicator;
 }
Example #18
0
 public TestResetInteractive(
     IWaitIndicator waitIndicator,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     Func<string, string> createReference,
     Func<string, string> createImport,
     bool buildSucceeds)
     : base(editorOptionsFactoryService, createReference, createImport)
 {
     _waitIndicator = waitIndicator;
     _buildSucceeds = buildSucceeds;
 }
 public CSharpInteractiveCommandHandler(
     CSharpVsInteractiveWindowProvider interactiveWindowProvider,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService, waitIndicator)
 {
     _interactiveWindowProvider = interactiveWindowProvider;
     _sendToInteractiveSubmissionProvider = new CSharpSendToInteractiveSubmissionProvider();
 }
        protected AbstractTextStructureNavigatorProvider(
            ITextStructureNavigatorSelectorService selectorService,
            IContentTypeRegistryService contentTypeService,
            IWaitIndicator waitIndicator)
        {
            Contract.ThrowIfNull(selectorService);
            Contract.ThrowIfNull(contentTypeService);

            _selectorService = selectorService;
            _contentTypeService = contentTypeService;
            _waitIndicator = waitIndicator;
        }
        internal FixMultipleSuggestedAction(
            Workspace workspace,
            ICodeActionEditHandlerService editHandler,
            IWaitIndicator waitIndicator,
            FixMultipleCodeAction codeAction,
            FixAllProvider provider,
            ITextBuffer subjectBufferOpt = null)
            : base(workspace, subjectBufferOpt, editHandler, waitIndicator, codeAction, provider, originalFixedDiagnostic: codeAction.GetTriggerDiagnostic())
        {
            _triggerDocumentOpt = codeAction.FixAllContext.Document;

            _telemetryId = GetTelemetryId(codeAction.FixAllContext.DiagnosticIds);
        }
Example #22
0
 public PeekableItemSource(
     ITextBuffer textBuffer,
     IPeekableItemFactory peekableItemFactory,
     IPeekResultFactory peekResultFactory,
     IMetadataAsSourceFileService metadataAsSourceService,
     IWaitIndicator waitIndicator)
 {
     _textBuffer = textBuffer;
     _peekableItemFactory = peekableItemFactory;
     _peekResultFactory = peekResultFactory;
     _metadataAsSourceService = metadataAsSourceService;
     _waitIndicator = waitIndicator;
 }
Example #23
0
 public InlineRenameService(
     IWaitIndicator waitIndicator,
     ITextBufferAssociatedViewService textBufferAssociatedViewService,
     ITextBufferFactoryService textBufferFactoryService,
     [ImportMany] IEnumerable<IRefactorNotifyService> refactorNotifyServices,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> listeners)
 {
     _waitIndicator = waitIndicator;
     _textBufferAssociatedViewService = textBufferAssociatedViewService;
     _textBufferFactoryService = textBufferFactoryService;
     _refactorNotifyServices = refactorNotifyServices;
     _aggregateListener = new AggregateAsynchronousOperationListener(listeners, FeatureAttribute.Rename);
 }
Example #24
0
 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IInlineRenameService inlineRenameService,
     IWaitIndicator waitIndicator,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
     [ImportMany] IEnumerable<Lazy<IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>, OrderableMetadata>> completionPresenters,
     [ImportMany] IEnumerable<Lazy<IBraceCompletionSessionProvider, BraceCompletionMetadata>> autoBraceCompletionChars)
     : this(editorOperationsFactoryService, undoHistoryRegistry, inlineRenameService, waitIndicator,
           ExtensionOrderer.Order(completionPresenters).Select(lazy => lazy.Value).FirstOrDefault(),
           asyncListeners, 
           autoBraceCompletionChars)
 {
 }
        public InlineRenameSession(
            InlineRenameService renameService,
            Workspace workspace,
            SnapshotSpan triggerSpan,
            IInlineRenameInfo renameInfo,
            IWaitIndicator waitIndicator,
            ITextBufferAssociatedViewService textBufferAssociatedViewService,
            ITextBufferFactoryService textBufferFactoryService,
            IEnumerable<IRefactorNotifyService> refactorNotifyServices,
            IAsynchronousOperationListener asyncListener) : base(assertIsForeground: true)
        {
            // This should always be touching a symbol since we verified that upon invocation
            _renameInfo = renameInfo;

            _triggerDocument = triggerSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
            if (_triggerDocument == null)
            {
                throw new InvalidOperationException(EditorFeaturesResources.TheTriggerspanIsNotIncludedInWorkspace);
            }

            _inlineRenameSessionDurationLogBlock = Logger.LogBlock(FunctionId.Rename_InlineSession, CancellationToken.None);

            _workspace = workspace;
            _workspace.WorkspaceChanged += OnWorkspaceChanged;

            _textBufferFactoryService = textBufferFactoryService;
            _textBufferAssociatedViewService = textBufferAssociatedViewService;
            _textBufferAssociatedViewService.SubjectBuffersConnected += OnSubjectBuffersConnected;

            _renameService = renameService;
            _waitIndicator = waitIndicator;
            _refactorNotifyServices = refactorNotifyServices;
            _asyncListener = asyncListener;
            _triggerView = textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).FirstOrDefault(v => v.HasAggregateFocus) ??
                textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).First();

            _optionSet = renameInfo.ForceRenameOverloads
                ? workspace.Options.WithChangedOption(RenameOptions.RenameOverloads, true)
                : workspace.Options;

            this.ReplacementText = triggerSpan.GetText();

            _baseSolution = _triggerDocument.Project.Solution;
            this.UndoManager = workspace.Services.GetService<IInlineRenameUndoManager>();

            this._editAndContinueWorkspaceService = workspace.Services.GetService<IEditAndContinueWorkspaceService>();
            this._editAndContinueWorkspaceService.BeforeDebuggingStateChanged += OnBeforeDebuggingStateChanged;

            InitializeOpenBuffers(triggerSpan);
        }
            internal TextStructureNavigator(
                ITextBuffer subjectBuffer,
                ITextStructureNavigator naturalLanguageNavigator,
                AbstractTextStructureNavigatorProvider provider,
                IWaitIndicator waitIndicator)
            {
                Contract.ThrowIfNull(subjectBuffer);
                Contract.ThrowIfNull(naturalLanguageNavigator);
                Contract.ThrowIfNull(provider);

                _subjectBuffer = subjectBuffer;
                _naturalLanguageNavigator = naturalLanguageNavigator;
                _provider = provider;
                _waitIndicator = waitIndicator;
            }
 public SuggestedActionsSourceProvider(
     ICodeRefactoringService codeRefactoringService,
     IDiagnosticAnalyzerService diagnosticService,
     ICodeFixService codeFixService,
     ICodeActionEditHandlerService editHandler,
     IWaitIndicator waitIndicator,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
 {
     _codeRefactoringService = codeRefactoringService;
     _diagnosticService = diagnosticService;
     _codeFixService = codeFixService;
     _editHandler = editHandler;
     _waitIndicator = waitIndicator;
     _listener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.LightBulb);
 }
        public VisualStudioSuppressionFixService(
            SVsServiceProvider serviceProvider,
            VisualStudioWorkspaceImpl workspace,
            IDiagnosticAnalyzerService diagnosticService,
            ICodeFixService codeFixService,
            IVisualStudioDiagnosticListSuppressionStateService suppressionStateService,
            IWaitIndicator waitIndicator)
        {
            _workspace = workspace;
            _diagnosticService = diagnosticService;
            _codeFixService = codeFixService;
            _suppressionStateService = (VisualStudioDiagnosticListSuppressionStateService)suppressionStateService;
            _waitIndicator = waitIndicator;
            _fixMultipleOccurencesService = workspace.Services.GetService<IFixMultipleOccurrencesService>();

            var errorList = serviceProvider.GetService(typeof(SVsErrorList)) as IErrorList;
            _tableControl = errorList?.TableControl;
        }
Example #29
0
 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IInlineRenameService inlineRenameService,
     IWaitIndicator waitIndicator,
     IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession> completionPresenter,
     IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
     IEnumerable<Lazy<IBraceCompletionSessionProvider, BraceCompletionMetadata>> autoBraceCompletionChars)
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry = undoHistoryRegistry;
     _inlineRenameService = inlineRenameService;
     _waitIndicator = waitIndicator;
     _completionPresenter = completionPresenter;
     _asyncListeners = asyncListeners;
     _autoBraceCompletionChars = autoBraceCompletionChars;
     _autoBraceCompletionCharSet = new Dictionary<IContentType, ImmutableHashSet<char>>();
 }
        public SuggestedActionsSourceProvider(
            ICodeRefactoringService codeRefactoringService,
            IDiagnosticAnalyzerService diagnosticService,
            ICodeFixService codeFixService,
            ICodeActionEditHandlerService editHandler,
            IWaitIndicator waitIndicator,
            [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
            [ImportMany] IEnumerable<Lazy<IImageMonikerService, OrderableMetadata>> imageMonikerServices)
        {
            _codeRefactoringService = codeRefactoringService;
            _diagnosticService = diagnosticService;
            _codeFixService = codeFixService;
            EditHandler = editHandler;
            WaitIndicator = waitIndicator;
            OperationListener = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.LightBulb);

            ImageMonikerServices = ExtensionOrderer.Order(imageMonikerServices).ToImmutableArray();
        }
Example #31
0
 public CallHierarchyCommandHandler([ImportMany] IEnumerable <ICallHierarchyPresenter> presenters, CallHierarchyProvider provider, IWaitIndicator waitIndicator)
     : base(presenters, provider, waitIndicator)
 {
 }
Example #32
0
        private async void AssertResetInteractive(
            TestWorkspace workspace,
            Project project,
            bool buildSucceeds,
            List <string> expectedReferences = null,
            List <string> expectedUsings     = null)
        {
            expectedReferences = expectedReferences ?? new List <string>();
            expectedUsings     = expectedUsings ?? new List <string>();

            InteractiveWindowTestHost testHost = new InteractiveWindowTestHost();
            List <string>             executedSubmissionCalls = new List <string>();

            void ExecuteSubmission(object _, string code)
            {
                executedSubmissionCalls.Add(code);
            }

            testHost.Evaluator.OnExecute += ExecuteSubmission;

            IWaitIndicator waitIndicator = workspace.GetService <IWaitIndicator>();
            IEditorOptionsFactoryService editorOptionsFactoryService = workspace.GetService <IEditorOptionsFactoryService>();
            var editorOptions    = editorOptionsFactoryService.GetOptions(testHost.Window.CurrentLanguageBuffer);
            var newLineCharacter = editorOptions.GetNewLineCharacter();

            TestResetInteractive resetInteractive = new TestResetInteractive(
                waitIndicator,
                editorOptionsFactoryService,
                CreateReplReferenceCommand,
                CreateImport,
                buildSucceeds: buildSucceeds)
            {
                References           = ImmutableArray.CreateRange(GetProjectReferences(workspace, project)),
                ReferenceSearchPaths = ImmutableArray.Create("rsp1", "rsp2"),
                SourceSearchPaths    = ImmutableArray.Create("ssp1", "ssp2"),
                ProjectNamespaces    = ImmutableArray.Create("System", "ResetInteractiveTestsDocument", "VisualBasicResetInteractiveTestsDocument"),
                NamespacesToImport   = ImmutableArray.Create("System", "ResetInteractiveTestsDocument"),
                ProjectDirectory     = "pj",
            };

            await resetInteractive.Execute(testHost.Window, "Interactive C#");

            // Validate that the project was rebuilt.
            Assert.Equal(1, resetInteractive.BuildProjectCount);
            Assert.Equal(0, resetInteractive.CancelBuildProjectCount);

            var expectedSubmissions = new List <string>();

            if (expectedReferences.Any())
            {
                expectedSubmissions.AddRange(expectedReferences.Select(r => r + newLineCharacter));
            }
            if (expectedUsings.Any())
            {
                expectedSubmissions.Add(string.Join(newLineCharacter, expectedUsings) + newLineCharacter);
            }

            AssertEx.Equal(expectedSubmissions, executedSubmissionCalls);

            testHost.Evaluator.OnExecute -= ExecuteSubmission;
        }
Example #33
0
 public TestResetInteractive(IWaitIndicator waitIndicator, Func <string, string> createReference, Func <string, string> createImport, bool buildSucceeds)
     : base(createReference, createImport)
 {
     _waitIndicator = waitIndicator;
     _buildSucceeds = buildSucceeds;
 }
 public AbstractMemberInsertingCompletionProvider(
     IWaitIndicator waitIndicator)
 {
     _waitIndicator = waitIndicator;
 }
Example #35
0
 public VisualStudioPullMemberUpService(IGlyphService glyphService, IWaitIndicator waitIndicator)
 {
     _glyphService  = glyphService;
     _waitIndicator = waitIndicator;
 }
Example #36
0
 public GoToImplementationCommandHandler(
     IWaitIndicator waitIndicator)
 {
     _waitIndicator = waitIndicator;
 }
 public static WaitIndicatorResult Wait(this IWaitIndicator waitIndicator, string titleAndMessage, bool allowCancel, Action <IWaitContext> action)
 {
     return(waitIndicator.Wait(titleAndMessage, titleAndMessage, allowCancel, action));
 }
Example #38
0
 public AbstractOverrideCompletionProvider(
     IWaitIndicator waitIndicator)
     : base(waitIndicator)
 {
 }
 public AbstractXmlTagCompletionCommandHandler(ITextUndoHistoryRegistry undoHistory, IWaitIndicator waitIndicator)
 {
     _undoHistory   = undoHistory;
     _waitIndicator = waitIndicator;
 }
 public XmlTagCompletionCommandHandler(ITextUndoHistoryRegistry undoHistory, IWaitIndicator waitIndicator)
     : base(undoHistory, waitIndicator)
 {
 }
 public GoToDefinitionCommandHandler(
     IWaitIndicator waitIndicator)
 {
     _waitIndicator = waitIndicator;
 }
 public VSTypeScriptWaitIndicatorWrapper(IWaitIndicator underlyingObject)
 => _underlyingObject = underlyingObject;
Example #43
0
 public FixAllGetFixesService(IWaitIndicator waitIndicator)
 {
     _waitIndicator = waitIndicator;
 }
Example #44
0
 public static WaitIndicatorResult Wait(this IWaitIndicator waitIndicator, string titleAndMessage, bool allowCancel, bool showProgress, Action <IWaitContext> action)
 => waitIndicator.Wait(titleAndMessage, titleAndMessage, allowCancel, showProgress, action);
Example #45
0
 public PartialCompletionProvider(IWaitIndicator waitIndicator)
     : base(waitIndicator)
 {
 }
 protected AbstractCallHierarchyCommandHandler(IEnumerable <ICallHierarchyPresenter> presenters, CallHierarchyProvider provider, IWaitIndicator waitIndicator)
 {
     _presenter     = presenters.FirstOrDefault();
     _provider      = provider;
     _waitIndicator = waitIndicator;
 }
Example #47
0
 public EncapsulateFieldCommandHandler(
     IWaitIndicator waitIndicator,
     ITextBufferUndoManagerProvider undoManager)
     : base(waitIndicator, undoManager)
 {
 }
Example #48
0
 protected AbstractChangeSignatureCommandHandler(
     IWaitIndicator waitIndicator)
 {
     _waitIndicator = waitIndicator;
 }
 public GoToAdjacentMemberCommandHandler(IWaitIndicator waitIndicator, IOutliningManagerService outliningManagerService)
 {
     _waitIndicator           = waitIndicator;
     _outliningManagerService = outliningManagerService;
 }
Example #50
0
 public CSharpChangeSignatureCommandHandler(IWaitIndicator waitIndicator)
     : base(waitIndicator)
 {
 }
Example #51
0
 public CallHierarchyCommandHandler([ImportMany] IEnumerable <ICallHierarchyPresenter> presenters, CallHierarchyProvider provider, IWaitIndicator waitIndicator)
 {
     _presenter     = presenters.FirstOrDefault();
     _provider      = provider;
     _waitIndicator = waitIndicator;
 }
Example #52
0
 public static WaitIndicatorResult Wait(
     this IWaitIndicator waitIndicator, string title, string message, bool allowCancel, Action <IWaitContext> action)
 {
     return(waitIndicator.Wait(title, message, allowCancel, showProgress: false, action: action));
 }
Example #53
0
        public InlineRenameSession(
            IThreadingContext threadingContext,
            InlineRenameService renameService,
            Workspace workspace,
            SnapshotSpan triggerSpan,
            IInlineRenameInfo renameInfo,
            IWaitIndicator waitIndicator,
            ITextBufferAssociatedViewService textBufferAssociatedViewService,
            ITextBufferFactoryService textBufferFactoryService,
            IFeatureServiceFactory featureServiceFactory,
            IEnumerable <IRefactorNotifyService> refactorNotifyServices,
            IAsynchronousOperationListener asyncListener)
            : base(threadingContext, assertIsForeground: true)
        {
            // This should always be touching a symbol since we verified that upon invocation
            _renameInfo = renameInfo;

            _triggerDocument = triggerSpan.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
            if (_triggerDocument == null)
            {
                throw new InvalidOperationException(EditorFeaturesResources.The_triggerSpan_is_not_included_in_the_given_workspace);
            }

            _inlineRenameSessionDurationLogBlock = Logger.LogBlock(FunctionId.Rename_InlineSession, CancellationToken.None);

            _workspace = workspace;
            _workspace.WorkspaceChanged += OnWorkspaceChanged;

            _textBufferFactoryService        = textBufferFactoryService;
            _textBufferAssociatedViewService = textBufferAssociatedViewService;
            _textBufferAssociatedViewService.SubjectBuffersConnected += OnSubjectBuffersConnected;

            // Disable completion when an inline rename session starts
            _featureService          = featureServiceFactory.GlobalFeatureService;
            _completionDisabledToken = _featureService.Disable(PredefinedEditorFeatureNames.Completion, this);

            _renameService          = renameService;
            _waitIndicator          = waitIndicator;
            _refactorNotifyServices = refactorNotifyServices;
            _asyncListener          = asyncListener;
            _triggerView            = textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).FirstOrDefault(v => v.HasAggregateFocus) ??
                                      textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).First();

            _optionSet = renameInfo.ForceRenameOverloads
                ? workspace.Options.WithChangedOption(RenameOptions.RenameOverloads, true)
                : workspace.Options;

            _initialRenameText   = triggerSpan.GetText();
            this.ReplacementText = _initialRenameText;

            _baseSolution    = _triggerDocument.Project.Solution;
            this.UndoManager = workspace.Services.GetService <IInlineRenameUndoManager>();

            _debuggingWorkspaceService = workspace.Services.GetService <IDebuggingWorkspaceService>();
            _debuggingWorkspaceService.BeforeDebuggingStateChanged += OnBeforeDebuggingStateChanged;

            if (_renameInfo is IInlineRenameInfoWithFileRename renameInfoWithFileRename)
            {
                FileRenameInfo = renameInfoWithFileRename.GetFileRenameInfo();
            }
            else
            {
                FileRenameInfo = InlineRenameFileRenameInfo.NotAllowed;
            }

            InitializeOpenBuffers(triggerSpan);
        }
Example #54
0
 public ProjectExplorerToolWindowServices(ProjectExplorerPackage package, OleMenuCommandService oleMenuCommandService, ProjectExplorerViewModelProvider viewModelProvider, IVsWindowSearchHostFactory windowSearchHostFactory, OptionService optionService, IWaitIndicator waitIndicator)
 {
     Package = package;
     OleMenuCommandService   = oleMenuCommandService;
     ViewModelProvider       = viewModelProvider;
     WindowSearchHostFactory = windowSearchHostFactory;
     OptionService           = optionService;
     WaitIndicator           = waitIndicator;
 }
 internal abstract ICommandHandler CreateCommandHandler(IWaitIndicator waitIndicator, ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService);