public IRSession GetOrCreate(Guid guid, IRHostClientApp hostClientApp) { IRSession session; if (!_sessions.TryGetValue(guid, out session)) { session = new RSessionMock(); _sessions[guid] = session; } return session; }
public IRSession GetOrCreate(Guid guid, IRHostClientApp hostClientApp) { IRSession session; if (!_sessions.TryGetValue(guid, out session)) { session = new RSessionMock(); _sessions[guid] = session; } return(session); }
public RHostScript(IRSessionProvider sessionProvider, IRHostClientApp clientApp = null) { SessionProvider = sessionProvider; Session = SessionProvider.GetOrCreate(GuidList.InteractiveWindowRSessionGuid, clientApp ?? new RHostClientTestApp()); Session.IsHostRunning.Should().BeFalse(); Session.StartHostAsync(new RHostStartupInfo { Name = "RHostScript", RBasePath = RToolsSettings.Current.RBasePath, RHostCommandLineArguments = RToolsSettings.Current.RCommandLineArguments, CranMirrorName = RToolsSettings.Current.CranMirror }, 50000).Wait(); }
public RSession(int id, IRHostClientApp hostClientApp, Action onDispose) { Id = id; _hostClientApp = hostClientApp; _onDispose = onDispose; _disposeToken = DisposeToken.Create<RSession>(); _disableMutatingOnReadConsole = new CountdownDisposable(() => { if (!_delayedMutatedOnReadConsole) { return; } _delayedMutatedOnReadConsole = false; Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty)); }); }
public RSession(int id, IRHostClientApp hostClientApp, Action onDispose) { Id = id; _hostClientApp = hostClientApp; _onDispose = onDispose; _disposeToken = DisposeToken.Create <RSession>(); _disableMutatingOnReadConsole = new CountdownDisposable(() => { if (!_delayedMutatedOnReadConsole) { return; } _delayedMutatedOnReadConsole = false; Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty)); }); }
public RInteractiveWorkflow(IRSessionProvider sessionProvider , IRHistoryProvider historyProvider , IActiveWpfTextViewTracker activeTextViewTracker , IDebuggerModeTracker debuggerModeTracker , IRHostClientApp hostClientApp , ICoreShell coreShell , IRSettings settings , Action onDispose) { _activeTextViewTracker = activeTextViewTracker; _debuggerModeTracker = debuggerModeTracker; _settings = settings; _coreShell = coreShell; _onDispose = onDispose; RSession = sessionProvider.GetOrCreate(GuidList.InteractiveWindowRSessionGuid, hostClientApp); History = historyProvider.CreateRHistory(this); _operations = new RInteractiveWorkflowOperations(); _activeTextViewTracker.LastActiveTextViewChanged += LastActiveTextViewChanged; RSession.Disconnected += RSessionDisconnected; }
public IRSession GetOrCreate(Guid guid, IRHostClientApp hostClientApp) { _disposeToken.ThrowIfDisposed(); return _sessions.GetOrAdd(guid, id => new RSession(Interlocked.Increment(ref _sessionCounter), hostClientApp, () => DisposeSession(guid))); }
public VsRHostScript(IRHostClientApp clientApp = null) : base(VsAppShell.Current.ExportProvider.GetExportedValue<IRSessionProvider>(), clientApp) { }
public VsRHostScript(IRHostClientApp clientApp = null) : base(VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>(), clientApp) { }
public IRSession GetOrCreate(Guid guid, IRHostClientApp hostClientApp) { _disposeToken.ThrowIfDisposed(); return(_sessions.GetOrAdd(guid, id => new RSession(Interlocked.Increment(ref _sessionCounter), hostClientApp, () => DisposeSession(guid)))); }