Example #1
0
 public ToggleMultilineHistorySelectionCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow, IRToolsSettings settings)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdToggleMultilineSelection, false)
 {
     _history             = historyProvider.GetAssociatedRHistory(textView);
     _settings            = settings;
     _interactiveWorkflow = interactiveWorkflow;
 }
Example #2
0
 public SaveHistoryCommand(IApplicationShell appShell, ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false)
 {
     _appShell            = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #3
0
 public DeleteSelectedHistoryEntriesCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdDeleteSelectedHistoryEntries, false)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
     _ui = _interactiveWorkflow.Services.UI();
 }
Example #4
0
        public RInteractiveEvaluator(IRSessionProvider sessionProvider, IRSession session, IRHistory history, IConnectionManager connections, IServiceContainer services, IRSettings settings, IConsole console)
        {
            History = history;
            Session = session;

            _sessionProvider  = sessionProvider;
            _connections      = connections;
            _services         = services;
            _settings         = settings;
            _console          = console;
            _evaluatorRequest = new CountdownDisposable();
            _fs = _services.FileSystem();

            _disposableBag
            .Add(() => Session.Output                  -= SessionOnOutput)
            .Add(() => Session.Connected               -= SessionOnConnected)
            .Add(() => Session.Disconnected            -= SessionOnDisconnected)
            .Add(() => Session.BeforeRequest           -= SessionOnBeforeRequest)
            .Add(() => Session.AfterRequest            -= SessionOnAfterRequest)
            .Add(() => _sessionProvider.BrokerChanging -= OnBrokerChanging);

            _sessionProvider.BrokerChanging += OnBrokerChanging;

            Session.Output        += SessionOnOutput;
            Session.Connected     += SessionOnConnected;
            Session.Disconnected  += SessionOnDisconnected;
            Session.BeforeRequest += SessionOnBeforeRequest;
            Session.AfterRequest  += SessionOnAfterRequest;
        }
 public ToggleMultilineHistorySelectionCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdToggleMultilineSelection, false)
 {
     _history             = historyProvider.GetAssociatedRHistory(textView);
     _settings            = interactiveWorkflow.Shell.GetService <IRSettings>();
     _interactiveWorkflow = interactiveWorkflow;
 }
Example #6
0
        public RHistoryViewModelTest(RComponentsMefCatalogFixture catalog, ContainerHostMethodFixture containerHost) {
            _containerHost = containerHost;
            _exportProvider = catalog.CreateExportProvider();
            _history = _exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>().GetOrCreate().History;

            var containerFactory = _exportProvider.GetExportedValue<IRHistoryVisualComponentContainerFactory>();
            _historyVisualComponent = UIThreadHelper.Instance.Invoke(() => _history.GetOrCreateVisualComponent(containerFactory));
        }
Example #7
0
 public SaveHistoryCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false)
 {
     _ui = interactiveWorkflow.Shell.UI();
     _interactiveWorkflow = interactiveWorkflow;
     _settings            = _interactiveWorkflow.Shell.GetService <IRSettings>();
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #8
0
 public SendHistoryToSourceCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow, IContentTypeRegistryService contentTypeRegistry, IActiveWpfTextViewTracker textViewTracker)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendHistoryToSource, false)
 {
     _textViewTracker     = textViewTracker;
     _interactiveWorkflow = interactiveWorkflow;
     _contentType         = contentTypeRegistry.GetContentType(RContentTypeDefinition.ContentType);
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
 public SendHistoryToReplCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, new [] {
     new CommandId(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendHistoryToRepl),
     new CommandId(VSConstants.VsStd11, (int)VSConstants.VSStd11CmdID.ExecuteLineInInteractive)
 }, false)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #10
0
        public RHistoryViewModelTest(IExportProvider exportProvider, ContainerHostMethodFixture containerHost)
        {
            _containerHost = containerHost;
            _history       = exportProvider.GetExportedValue <IRInteractiveWorkflowProvider>().GetOrCreate().History;

            var containerFactory = exportProvider.GetExportedValue <IRHistoryVisualComponentContainerFactory>();

            _historyVisualComponent = UIThreadHelper.Instance.Invoke(() => _history.GetOrCreateVisualComponent(containerFactory));
        }
 public RInteractiveEvaluator(IRSession session, IRHistory history, ICoreShell coreShell, IRSettings settings) {
     History = history;
     Session = session;
     Session.Output += SessionOnOutput;
     Session.Disconnected += SessionOnDisconnected;
     Session.BeforeRequest += SessionOnBeforeRequest;
     _coreShell = coreShell;
     _settings = settings;
 }
Example #12
0
        public RHistoryViewModelTest(IServiceContainer services, ContainerHostMethodFixture containerHost)
        {
            _containerHost = containerHost;
            _history       = services.GetService <IRInteractiveWorkflowVisualProvider>().GetOrCreate().History;

            var containerFactory = services.GetService <IRHistoryVisualComponentContainerFactory>();

            _historyVisualComponent = UIThreadHelper.Instance.Invoke(() => _history.GetOrCreateVisualComponent(containerFactory));
        }
Example #13
0
 public RInteractiveEvaluator(IRSession session, IRHistory history, ICoreShell coreShell, IRSettings settings)
 {
     History                = history;
     Session                = session;
     Session.Output        += SessionOnOutput;
     Session.Disconnected  += SessionOnDisconnected;
     Session.BeforeRequest += SessionOnBeforeRequest;
     _coreShell             = coreShell;
     _settings              = settings;
 }
        public RHistoryWindowVisualComponent(ITextBuffer historyTextBuffer, IRHistoryProvider historyProvider, ITextEditorFactoryService textEditorFactory, IVisualComponentContainer <IRHistoryWindowVisualComponent> container)
        {
            _container = container;
            _history   = historyProvider.GetAssociatedRHistory(historyTextBuffer);

            TextView = CreateTextView(historyTextBuffer, textEditorFactory);
            TextView.Selection.SelectionChanged += TextViewSelectionChanged;

            Control = textEditorFactory.CreateTextViewHost(TextView, false).HostControl;
        }
        public SendHistoryToSourceCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow, IContentTypeRegistryService contentTypeRegistry, IActiveWpfTextViewTracker textViewTracker)
            : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendHistoryToSource, false) {

            _textViewTracker = textViewTracker;
            _interactiveWorkflow = interactiveWorkflow;
            _history = historyProvider.GetAssociatedRHistory(textView);

            _contentTypes.Add(contentTypeRegistry.GetContentType(RContentTypeDefinition.ContentType));
            _contentTypes.Add(contentTypeRegistry.GetContentType(MdProjectionContentTypeDefinition.ContentType));
        }
        public RHistoryWindowVisualComponent(ITextBuffer historyTextBuffer, IRHistoryProvider historyProvider, ITextEditorFactoryService textEditorFactory, IVisualComponentContainer<IRHistoryWindowVisualComponent> container) {
            _container = container;
            _history = historyProvider.GetAssociatedRHistory(historyTextBuffer);

            TextView = CreateTextView(historyTextBuffer, textEditorFactory);
            Control = textEditorFactory.CreateTextViewHost(TextView, false).HostControl;
            Controller = ServiceManagerBase.GetService<ICommandTarget>(TextView);

            TextView.Selection.SelectionChanged += TextViewSelectionChanged;
        }
Example #17
0
        public async Task InitializeProjectFromDiskAsync()
        {
            await Project.CreateInMemoryImport();

            _fileWatcher.Start();

            await _threadHandling.SwitchToUIThread();

            // Make sure R package is loaded
            VsAppShell.EnsurePackageLoaded(RGuidList.RPackageGuid);

            // Verify project is not on a network share and give warning if it is
            CheckRemoteDrive(_projectDirectory);

            _workflow = _workflowProvider.GetOrCreate();
            _session  = _workflow.RSession;
            _history  = _workflow.History;

            if (_workflow.ActiveWindow == null)
            {
                var window = await _workflow.GetOrCreateVisualComponent(_componentContainerFactory);

                window.Container.Show(true);
            }

            try {
                await _session.HostStarted;
            } catch (Exception) {
                return;
            }

            // TODO: need to compute the proper paths for remote, but they might not even exist if the project hasn't been deployed.
            // https://github.com/Microsoft/RTVS/issues/2223
            if (!_session.IsRemote)
            {
                var  rdataPath            = Path.Combine(_projectDirectory, DefaultRDataName);
                bool loadDefaultWorkspace = _fileSystem.FileExists(rdataPath) && await GetLoadDefaultWorkspace(rdataPath);

                using (var evaluation = await _session.BeginEvaluationAsync()) {
                    if (loadDefaultWorkspace)
                    {
                        await evaluation.LoadWorkspaceAsync(rdataPath);
                    }

                    await evaluation.SetWorkingDirectoryAsync(_projectDirectory);
                }

                _toolsSettings.WorkingDirectory = _projectDirectory;
            }

            _history.TryLoadFromFile(Path.Combine(_projectDirectory, DefaultRHistoryName));

            CheckSurveyNews();
        }
Example #18
0
        protected override void OnCreate()
        {
            Component = new RHistoryWindowVisualComponent(_historyTextBuffer, _historyProvider, _textEditorFactory, this);

            _history = _historyProvider.GetAssociatedRHistory(Component.TextView);
            _history.HistoryChanged += OnHistoryChanged;
            _historyFiltering        = _historyProvider.CreateFiltering(Component);
            _commandTarget           = new CommandTargetToOleShim(Component.TextView, ServiceManager.GetService <ICommandTarget>(Component.TextView));

            base.OnCreate();
        }
        public void Dispose() {
            if (TextView == null) {
                return;
            }

            Controller = null;
            TextView.Selection.SelectionChanged -= TextViewSelectionChanged;
            TextView.Close();
            TextView = null;
            _history = null;
        }
Example #20
0
 protected override void Dispose(bool disposing)
 {
     if (disposing && _history != null)
     {
         _commandTarget           = null;
         _history.HistoryChanged -= OnHistoryChanged;
         _history  = null;
         Component = null;
     }
     base.Dispose(disposing);
 }
        public void Dispose()
        {
            if (TextView == null)
            {
                return;
            }

            TextView.Selection.SelectionChanged -= TextViewSelectionChanged;
            TextView.Close();
            TextView = null;
            _history = null;
        }
Example #22
0
 public RInteractiveEvaluator(IRSession session, IRHistory history, IConnectionManager connections, ICoreShell coreShell, IRSettings settings)
 {
     History                = history;
     Session                = session;
     Session.Output        += SessionOnOutput;
     Session.Disconnected  += SessionOnDisconnected;
     Session.BeforeRequest += SessionOnBeforeRequest;
     Session.AfterRequest  += SessionOnAfterRequest;
     _connections           = connections;
     _coreShell             = coreShell;
     _settings              = settings;
     _evaluatorRequest      = new CountdownDisposable();
 }
        public RHistoryFiltering(IRHistory history, IRHistoryWindowVisualComponent visualComponent, IRSettings settings, ITextSearchService2 textSearchService) {
            _history = history;
            _history.HistoryChanging += HistoryChanging;
            _history.HistoryChanged += HistoryChanged;

            _settings = settings;
            _textSearchService = textSearchService;
            _textView = visualComponent.TextView;
            _textBuffer = _textView.TextDataModel.DataBuffer;

            IElisionBuffer elisionBuffer;
            _textView.TextViewModel.Properties.TryGetProperty(IntraTextAdornmentBufferKey, out elisionBuffer);
            _elisionBuffer = elisionBuffer;
        }
Example #24
0
 public RInteractiveEvaluator(IRSessionProvider sessionProvider, IRSession session, IRHistory history, IConnectionManager connections, ICoreShell coreShell, IRSettings settings, IConsole console) {
     History = history;
     Session = session;
     Session.Output += SessionOnOutput;
     Session.Disconnected += SessionOnDisconnected;
     Session.BeforeRequest += SessionOnBeforeRequest;
     Session.AfterRequest += SessionOnAfterRequest;
     _sessionProvider = sessionProvider;
     _connections = connections;
     _coreShell = coreShell;
     _settings = settings;
     _console = console;
     _evaluatorRequest = new CountdownDisposable();
 }
Example #25
0
        public async Task InitializeProjectFromDiskAsync()
        {
            await Project.CreateInMemoryImport();

            _fileWatcher.Start();

            // Force REPL window up and continue only when it is shown
            await _threadHandling.SwitchToUIThread();

            // Make sure R package is loaded
            VsAppShell.EnsurePackageLoaded(RGuidList.RPackageGuid);

            // Verify project is not on a network share and give warning if it is
            CheckRemoteDrive(_projectDirectory);

            _workflow = _workflowProvider.GetOrCreate();
            _session  = _workflow.RSession;
            _history  = _workflow.History;

            if (_workflow.ActiveWindow == null)
            {
                var window = await _workflow.GetOrCreateVisualComponent(_componentContainerFactory);

                window.Container.Show(true);
            }

            try {
                await _session.HostStarted;
            } catch (Exception) {
                return;
            }

            var  rdataPath            = Path.Combine(_projectDirectory, DefaultRDataName);
            bool loadDefaultWorkspace = _fileSystem.FileExists(rdataPath) && await GetLoadDefaultWorkspace(rdataPath);

            using (var evaluation = await _session.BeginEvaluationAsync()) {
                if (loadDefaultWorkspace)
                {
                    await evaluation.LoadWorkspace(rdataPath);
                }

                await evaluation.SetWorkingDirectory(_projectDirectory);
            }

            _toolsSettings.WorkingDirectory = _projectDirectory;
            _history.TryLoadFromFile(Path.Combine(_projectDirectory, DefaultRHistoryName));

            CheckSurveyNews();
        }
Example #26
0
        public RHistoryFiltering(IRHistory history, IRHistoryWindowVisualComponent visualComponent, IRSettings settings, ITextSearchService2 textSearchService)
        {
            _history = history;
            _history.HistoryChanging += HistoryChanging;
            _history.HistoryChanged  += HistoryChanged;

            _settings          = settings;
            _textSearchService = textSearchService;
            _textView          = visualComponent.TextView;
            _textBuffer        = _textView.TextDataModel.DataBuffer;

            IElisionBuffer elisionBuffer;

            _textView.TextViewModel.Properties.TryGetProperty(IntraTextAdornmentBufferKey, out elisionBuffer);
            _elisionBuffer = elisionBuffer;
        }
 public HistoryNavigationCommand(ITextView textView, IRInteractiveWorkflow interactiveWorkflow, ICompletionBroker completionBroker, IEditorOperationsFactoryService editorFactory) :
     base(textView, new[] {
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.UP),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.DOWN),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.LEFT),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.RIGHT),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.UP_EXT),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.DOWN_EXT),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.LEFT_EXT),
         new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.RIGHT_EXT)
     }, false) {
     _completionBroker = completionBroker;
     _editorFactory = editorFactory;
     _interactiveWorkflow = interactiveWorkflow;
     _history = interactiveWorkflow.History;
 }
Example #28
0
 public HistoryNavigationCommand(ITextView textView, IRInteractiveWorkflowVisual interactiveWorkflow, ICompletionBroker completionBroker, IEditorOperationsFactoryService editorFactory) :
     base(textView, new[] {
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.UP),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.DOWN),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.LEFT),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.RIGHT),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.UP_EXT),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.DOWN_EXT),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.LEFT_EXT),
     new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.RIGHT_EXT)
 }, false)
 {
     _completionBroker    = completionBroker;
     _editorFactory       = editorFactory;
     _interactiveWorkflow = interactiveWorkflow;
     _history             = interactiveWorkflow.History;
 }
        public HistorySelectionTextAdornment(IWpfTextView textView, IEditorFormatMapService editorFormatMapService, IRHistoryProvider historyProvider) {
            _textView = textView;
            _layer = textView.GetAdornmentLayer("HistorySelectionTextAdornment");

            _editorFormatMap = editorFormatMapService.GetEditorFormatMap(_textView);
            _history = historyProvider.GetAssociatedRHistory(_textView);

            // Advise to events
            _editorFormatMap.FormatMappingChanged += OnFormatMappingChanged;
            _textView.VisualElement.GotKeyboardFocus += OnGotKeyboardFocus;
            _textView.VisualElement.LostKeyboardFocus += OnLostKeyboardFocus;
            _textView.LayoutChanged += OnLayoutChanged;
            _textView.Closed += OnClosed;
            _history.SelectionChanged += OnSelectionChanged;

            _activeVisualToolset = CreateVisualToolset(ActiveSelectionPropertiesName, SystemColors.HighlightColor);
            _inactiveVisualToolset = CreateVisualToolset(InactiveSelectionPropertiesName, SystemColors.GrayTextColor);
            Redraw();
        }
Example #30
0
        public async Task InitializeProjectFromDiskAsync() {
            await Project.CreateInMemoryImport();
            _fileWatcher.Start();

            // Force REPL window up and continue only when it is shown
            await _threadHandling.SwitchToUIThread();

            // Make sure R package is loaded
            VsAppShell.EnsurePackageLoaded(RGuidList.RPackageGuid);

            // Verify project is not on a network share and give warning if it is
            CheckRemoteDrive(_projectDirectory);

            _workflow = _workflowProvider.GetOrCreate();
            _session = _workflow.RSession;
            _history = _workflow.History;

            if (_workflow.ActiveWindow == null) {
                var window = await _workflow.GetOrCreateVisualComponent(_componentContainerFactory);
                window.Container.Show(true);
            }

            try {
                await _session.HostStarted;
            } catch (Exception) {
                return;
            }

            var rdataPath = Path.Combine(_projectDirectory, DefaultRDataName);
            bool loadDefaultWorkspace = _fileSystem.FileExists(rdataPath) && await GetLoadDefaultWorkspace(rdataPath);

            using (var evaluation = await _session.BeginEvaluationAsync()) {
                if (loadDefaultWorkspace) {
                    await evaluation.LoadWorkspace(rdataPath);
                }

                await evaluation.SetWorkingDirectory(_projectDirectory);
            }

            _toolsSettings.WorkingDirectory = _projectDirectory;
            _history.TryLoadFromFile(Path.Combine(_projectDirectory, DefaultRHistoryName));
        }
Example #31
0
        public HistorySelectionTextAdornment(IWpfTextView textView, IEditorFormatMapService editorFormatMapService, IRHistoryProvider historyProvider)
        {
            _textView = textView;
            _layer    = textView.GetAdornmentLayer("HistorySelectionTextAdornment");

            _editorFormatMap = editorFormatMapService.GetEditorFormatMap(_textView);
            _history         = historyProvider.GetAssociatedRHistory(_textView);

            // Advise to events
            _editorFormatMap.FormatMappingChanged     += OnFormatMappingChanged;
            _textView.VisualElement.GotKeyboardFocus  += OnGotKeyboardFocus;
            _textView.VisualElement.LostKeyboardFocus += OnLostKeyboardFocus;
            _textView.LayoutChanged   += OnLayoutChanged;
            _textView.Closed          += OnClosed;
            _history.SelectionChanged += OnSelectionChanged;

            _activeVisualToolset   = CreateVisualToolset(ActiveSelectionPropertiesName, SystemColors.HighlightColor);
            _inactiveVisualToolset = CreateVisualToolset(InactiveSelectionPropertiesName, SystemColors.GrayTextColor);
            Redraw();
        }
Example #32
0
 public PrevHistoryReplCommand(IRInteractiveWorkflowVisual interactiveWorkflow) :
     base(interactiveWorkflow, RPackageCommandId.icmdPrevHistoryRepl)
 {
     _history = interactiveWorkflow.History;
 }
Example #33
0
 public SaveHistoryCommand(IApplicationShell appShell, ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false) {
     _appShell = appShell;
     _interactiveWorkflow = interactiveWorkflow;
     _history = historyProvider.GetAssociatedRHistory(textView);
 }
 public HistoryWindowPaneMouseProcessor(IRHistory history) {
     _history = history;
 }
Example #35
0
 public NextHistoryReplCommand(IRInteractiveWorkflow interactiveWorkflow) :
     base(interactiveWorkflow, RPackageCommandId.icmdNextHistoryRepl)
 {
     _history = interactiveWorkflow.History;
 }
 public CopySelectedHistoryCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Copy, false) {
     _interactiveWorkflow = interactiveWorkflow;
     _history = historyProvider.GetAssociatedRHistory(textView);
 }
Example #37
0
 public RHistoryCompletionProvider(IRHistory history, IImageService imageService)
 {
     _history = history;
     _glyph   = imageService.GetImage("History");
 }
 public DeleteSelectedHistoryEntriesCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdDeleteSelectedHistoryEntries, false) {
     _interactiveWorkflow = interactiveWorkflow;
     _history = historyProvider.GetAssociatedRHistory(textView);
 }
 public ToggleMultilineHistorySelectionCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow, IRToolsSettings settings)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdToggleMultilineSelection, false) {
     _history = historyProvider.GetAssociatedRHistory(textView);
     _settings = settings;
     _interactiveWorkflow = interactiveWorkflow;
 }
 public HistoryWindowVsStd97CmdIdSelectAllCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, SelectAllCommandIds, false) {
     _interactiveWorkflow = interactiveWorkflow;
     _history = historyProvider.GetAssociatedRHistory(textView);
 }
Example #41
0
 public CopySelectedHistoryCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow)
     : base(textView, VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Copy, false)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #42
0
        public async Task InitializeProjectFromDiskAsync() {
            await Project.CreateInMemoryImport();
            _fileWatcher.Start();

            await _threadHandling.SwitchToUIThread();
            // Make sure R package is loaded
            VsAppShell.EnsurePackageLoaded(RGuidList.RPackageGuid);

            // Verify project is not on a network share and give warning if it is
            CheckRemoteDrive(_projectDirectory);

            _workflow = _workflowProvider.GetOrCreate();
            _session = _workflow.RSession;
            _history = _workflow.History;

            if (_workflow.ActiveWindow == null) {
                var window = await _workflow.GetOrCreateVisualComponentAsync();
                window.Container.Show(focus: true, immediate: false);
            }

            try {
                await _session.HostStarted;
            } catch (Exception) {
                return;
            }

            // TODO: need to compute the proper paths for remote, but they might not even exist if the project hasn't been deployed.
            // https://github.com/Microsoft/RTVS/issues/2223
            if (!_session.IsRemote) {
                var rdataPath = Path.Combine(_projectDirectory, DefaultRDataName);
                bool loadDefaultWorkspace = _coreShell.Services.FileSystem.FileExists(rdataPath) && await GetLoadDefaultWorkspace(rdataPath);

                if (loadDefaultWorkspace) {
                    await _session.LoadWorkspaceAsync(rdataPath);
                }
                await _session.SetWorkingDirectoryAsync(_projectDirectory);

                _toolsSettings.WorkingDirectory = _projectDirectory;
            }

            _history.TryLoadFromFile(Path.Combine(_projectDirectory, DefaultRHistoryName));

            CheckSurveyNews();
        }
Example #43
0
 protected NavigationCommandBase(ITextView textView, IRHistoryProvider historyProvider, VSConstants.VSStd2KCmdID id)
     : base(textView, VSConstants.VSStd2K, (int)id, false)
 {
     History = historyProvider.GetAssociatedRHistory(textView);
 }
Example #44
0
 public LoadHistoryCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdLoadHistory, false)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #45
0
 protected NavigationCommandBase(ITextView textView, IRHistoryProvider historyProvider, params VSConstants.VSStd2KCmdID[] ids)
     : base(textView, GetCommandIds(ids), false)
 {
     History = historyProvider.GetAssociatedRHistory(textView);
 }
Example #46
0
 public HistoryWindowVsStd97CmdIdSelectAllCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, SelectAllCommandIds, false)
 {
     _interactiveWorkflow = interactiveWorkflow;
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Example #47
0
 public HistoryWindowPaneMouseProcessor(IRHistory history)
 {
     _history = history;
 }