예제 #1
0
 public RenameCommandHandler(
     IThreadingContext threadingContext,
     InlineRenameService renameService)
 {
     _threadingContext = threadingContext;
     _renameService    = renameService;
 }
예제 #2
0
 public RenameClassificationTaggerProvider(
     InlineRenameService renameService,
     IClassificationTypeRegistryService classificationTypeRegistryService)
 {
     _renameService      = renameService;
     _classificationType = classificationTypeRegistryService.GetClassificationType(ClassificationTypeDefinitions.InlineRenameField);
 }
예제 #3
0
 public DashboardAdornmentProvider(
     InlineRenameService renameService,
     IEditorFormatMapService editorFormatMapService)
 {
     _renameService          = renameService;
     _editorFormatMapService = editorFormatMapService;
 }
예제 #4
0
 public RenameCommandHandler(
     InlineRenameService renameService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _renameService = renameService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
 protected AbstractRenameCommandHandler(
     IThreadingContext threadingContext,
     InlineRenameService renameService)
 {
     _threadingContext = threadingContext;
     _renameService    = renameService;
 }
예제 #6
0
 public RenameCommandHandler(
     IThreadingContext threadingContext,
     InlineRenameService renameService,
     IAsynchronousOperationListenerProvider asynchronousOperationListenerProvider)
     : base(threadingContext, renameService, asynchronousOperationListenerProvider)
 {
 }
예제 #7
0
 public RenameClassificationTagger(
     ITextBuffer buffer,
     InlineRenameService renameService,
     IClassificationType classificationType
     ) : base(buffer, renameService)
 {
     _classificationType = classificationType;
 }
 public DashboardAdornmentProvider(
     InlineRenameService renameService,
     IEditorFormatMapService editorFormatMapService,
     [Import(AllowDefault = true)] IDashboardColorUpdater?dashboardColorUpdater)
 {
     _renameService          = renameService;
     _editorFormatMapService = editorFormatMapService;
     _dashboardColorUpdater  = dashboardColorUpdater;
 }
예제 #9
0
 public RenameCommandHandler(
     InlineRenameService renameService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
 {
     _renameService = renameService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _waitIndicator = waitIndicator;
 }
예제 #10
0
 protected AbstractRenameCommandHandler(
     IThreadingContext threadingContext,
     InlineRenameService renameService,
     IAsynchronousOperationListenerProvider asynchronousOperationListenerProvider)
 {
     _threadingContext = threadingContext;
     _renameService    = renameService;
     _listener         = asynchronousOperationListenerProvider.GetListener(FeatureAttribute.Rename);
 }
예제 #11
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;

            this.ReplacementText = triggerSpan.GetText();

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

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

            InitializeOpenBuffers(triggerSpan);
        }
예제 #12
0
 public RenameCommandHandler(
     InlineRenameService renameService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
 {
     _renameService = renameService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _waitIndicator = waitIndicator;
 }
 public InlineRenameAdornmentProvider(
     InlineRenameService renameService,
     IEditorFormatMapService editorFormatMapService,
     [Import(AllowDefault = true)] IInlineRenameColorUpdater?dashboardColorUpdater,
     IGlobalOptionService globalOptionService)
 {
     _renameService          = renameService;
     _editorFormatMapService = editorFormatMapService;
     _dashboardColorUpdater  = dashboardColorUpdater;
     _globalOptionService    = globalOptionService;
 }
예제 #14
0
        protected AbstractRenameTagger(ITextBuffer buffer, InlineRenameService renameService)
        {
            _buffer        = buffer;
            _renameService = renameService;

            _renameService.ActiveSessionChanged += OnActiveSessionChanged;

            if (_renameService.ActiveSession != null)
            {
                AttachToSession(_renameService.ActiveSession);
            }
        }
예제 #15
0
        public DashboardAdornmentManager(InlineRenameService renameService, IWpfTextView textView)
        {
            _renameService = renameService;
            _textView = textView;

            _adornmentLayer = textView.GetAdornmentLayer(DashboardAdornmentProvider.AdornmentLayerName);

            _renameService.ActiveSessionChanged += OnActiveSessionChanged;
            _textView.Closed += OnTextViewClosed;

            UpdateAdornments();
        }
        public DashboardAdornmentManager(InlineRenameService renameService, IWpfTextView textView)
        {
            _renameService = renameService;
            _textView      = textView;

            _adornmentLayer = textView.GetAdornmentLayer(DashboardAdornmentProvider.AdornmentLayerName);

            _renameService.ActiveSessionChanged += OnActiveSessionChanged;
            _textView.Closed += OnTextViewClosed;

            UpdateAdornments();
        }
예제 #17
0
        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);
        }
예제 #18
0
        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 = workspace.Options;

            this.ReplacementText = triggerSpan.GetText();

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

            InitializeOpenBuffers(triggerSpan);
        }
        public DashboardAdornmentManager(
            InlineRenameService renameService,
            IEditorFormatMapService editorFormatMapService,
            IDashboardColorUpdater?dashboardColorUpdater,
            IWpfTextView textView)
        {
            _renameService          = renameService;
            _editorFormatMapService = editorFormatMapService;
            _dashboardColorUpdater  = dashboardColorUpdater;
            _textView = textView;

            _adornmentLayer = textView.GetAdornmentLayer(DashboardAdornmentProvider.AdornmentLayerName);

            _renameService.ActiveSessionChanged += OnActiveSessionChanged;
            _textView.Closed += OnTextViewClosed;

            UpdateAdornments();
        }
예제 #20
0
 public InlineRenameUndoManager(InlineRenameService inlineRenameService) : base(inlineRenameService)
 {
 }
예제 #21
0
 public RenameTagger(ITextBuffer buffer, InlineRenameService renameService)
     : base(buffer, renameService)
 {
 }
예제 #22
0
 public RenameTaggerProvider(InlineRenameService renameService)
 {
     _renameService = renameService;
 }
예제 #23
0
 public RenameCommandHandler(IThreadingContext threadingContext, InlineRenameService renameService)
     : base(threadingContext, renameService)
 {
 }
예제 #24
0
 public AbstractInlineRenameUndoManager(InlineRenameService inlineRenameService)
 {
     this.InlineRenameService = inlineRenameService;
 }
예제 #25
0
 public UndoManagerServiceFactory(InlineRenameService inlineRenameService)
 {
     _inlineRenameService = inlineRenameService;
 }
예제 #26
0
 public DashboardAdornmentProvider(
     InlineRenameService renameService)
 {
     _renameService = renameService;
 }
예제 #27
0
 public DashboardAdornmentProvider(
     InlineRenameService renameService)
 {
     _renameService = renameService;
 }
예제 #28
0
        public InlineRenameSession(
            IThreadingContext threadingContext,
            InlineRenameService renameService,
            Workspace workspace,
            SnapshotSpan triggerSpan,
            IInlineRenameInfo renameInfo,
            SymbolRenameOptions options,
            bool previewChanges,
            IUIThreadOperationExecutor uiThreadOperationExecutor,
            ITextBufferAssociatedViewService textBufferAssociatedViewService,
            ITextBufferFactoryService textBufferFactoryService,
            IFeatureServiceFactory featureServiceFactory,
            IEnumerable <IRefactorNotifyService> refactorNotifyServices,
            IAsynchronousOperationListener asyncListener)
        {
            // This should always be touching a symbol since we verified that upon invocation
            _threadingContext = threadingContext;
            _renameInfo       = renameInfo;

            _triggerSpan     = triggerSpan;
            _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;
            _uiThreadOperationExecutor = uiThreadOperationExecutor;
            _refactorNotifyServices    = refactorNotifyServices;
            _asyncListener             = asyncListener;
            _triggerView = textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).FirstOrDefault(v => v.HasAggregateFocus) ??
                           textBufferAssociatedViewService.GetAssociatedTextViews(triggerSpan.Snapshot.TextBuffer).First();

            _options        = options;
            _previewChanges = previewChanges;

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

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

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

            InitializeOpenBuffers(triggerSpan);
        }