Пример #1
0
 public RtvsTelemetry(IPackageIndex packageIndex, IRToolsSettings settings, IREditorSettings editorSettings, ITelemetryService service = null)
 {
     _packageIndex    = packageIndex;
     _settings        = settings;
     _editorSettings  = editorSettings;
     TelemetryService = service ?? VsAppShell.Current.GetService <ITelemetryService>();
 }
Пример #2
0
        public VariableView(IRToolsSettings settings, ICoreShell shell)
        {
            _settings = settings;
            _shell    = shell;

            InitializeComponent();

            _aggregator = _shell.ExportProvider.GetExportedValue <IObjectDetailsViewerAggregator>();

            SetRootNode(VariableViewModel.Ellipsis);

            SortDirection         = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var theme = shell.ExportProvider.GetExportedValue <IThemeUtilities>();

            theme.SetImageBackgroundColor(RootTreeGrid, Brushes.ToolWindowBackgroundColorKey);
            theme.SetThemeScrollBars(RootTreeGrid);

            var workflow = VsAppShell.Current.ExportProvider.GetExportedValue <IRInteractiveWorkflowProvider>().GetOrCreate();

            _session = workflow.RSession;

            _environmentProvider            = new REnvironmentProvider(_session, shell.Services.MainThread);
            EnvironmentComboBox.DataContext = _environmentProvider;
            _environmentProvider.RefreshEnvironmentsAsync().DoNotWait();
        }
Пример #3
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject
                                 , [ImportMany("Microsoft.VisualStudio.ProjectSystem.Microsoft.VisualStudio.Shell.Interop.IVsProject")] IEnumerable <Lazy <IVsProject> > cpsIVsProjects
                                 , IProjectLockService projectLockService
                                 , IRInteractiveWorkflowProvider workflowProvider
                                 , IInteractiveWindowComponentContainerFactory componentContainerFactory
                                 , IRToolsSettings toolsSettings
                                 , IThreadHandling threadHandling
                                 , ISurveyNewsService surveyNews
                                 , [Import(AllowDefault = true)] IProjectItemDependencyProvider dependencyProvider
                                 , ICoreShell coreShell)
        {
            _unconfiguredProject = unconfiguredProject;
            _cpsIVsProjects      = cpsIVsProjects;
            _projectLockService  = projectLockService;
            _workflowProvider    = workflowProvider;

            _toolsSettings      = toolsSettings;
            _threadHandling     = threadHandling;
            _surveyNews         = surveyNews;
            _dependencyProvider = dependencyProvider;
            _coreShell          = coreShell;

            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectRenamedOnWriter += ProjectRenamedOnWriter;
            unconfiguredProject.ProjectUnloading       += ProjectUnloading;
            _fileWatcher        = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, 1000, _coreShell.Services.FileSystem, new RMsBuildFileSystemFilter(), coreShell.Services.Log);
            _fileWatcher.Error += FileWatcherError;
            Project             = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher, _dependencyProvider, coreShell.Services.Log);
        }
Пример #4
0
        public void RunBrowserTest(WebBrowserRole role, Guid guid, string title, IRToolsSettings externalSettings, IRToolsSettings internalSettings)
        {
            var shell = Substitute.For <ICoreShell>();
            var ps    = Substitute.For <IProcessServices>();
            var vswbs = Substitute.For <IVsWebBrowsingService>();

            shell.Process().Returns(ps);
            shell.GetService <IVsWebBrowsingService>(typeof(SVsWebBrowsingService)).Returns(vswbs);

            var wbs = new WebBrowserServices(shell);

            wbs.OpenBrowser(role, _url);
            shell.Process().Received().Start(_url);

            ps.ClearReceivedCalls();
            wbs = new WebBrowserServices(shell);
            wbs.OpenBrowser(role, _url);

            UIThreadHelper.Instance.DoEvents();
            shell.Process().DidNotReceive().Start(_url);

            IVsWebBrowser  vswb;
            IVsWindowFrame frame;

            vswbs.Received().CreateWebBrowser(Arg.Any <uint>(), guid, title, _url, null, out vswb, out frame);
        }
Пример #5
0
 public static void Initialize(IPackageIndex packageIndex, IRToolsSettings settings, IREditorSettings editorSettings, ITelemetryService service = null)
 {
     if (Current == null)
     {
         Current = new RtvsTelemetry(packageIndex, settings, editorSettings, service);
     }
 }
Пример #6
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject
                                 , [ImportMany("Microsoft.VisualStudio.ProjectSystem.Microsoft.VisualStudio.Shell.Interop.IVsProject")] IEnumerable <Lazy <IVsProject> > cpsIVsProjects
                                 , IProjectLockService projectLockService
                                 , IRInteractiveWorkflowProvider workflowProvider
                                 , IInteractiveWindowComponentContainerFactory componentContainerFactory
                                 , IRToolsSettings toolsSettings
                                 , IFileSystem fileSystem
                                 , IThreadHandling threadHandling
                                 , ISurveyNewsService surveyNews)
        {
            _unconfiguredProject       = unconfiguredProject;
            _cpsIVsProjects            = cpsIVsProjects;
            _workflowProvider          = workflowProvider;
            _componentContainerFactory = componentContainerFactory;

            _toolsSettings    = toolsSettings;
            _fileSystem       = fileSystem;
            _threadHandling   = threadHandling;
            _surveyNews       = surveyNews;
            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectUnloading += ProjectUnloading;
            _fileWatcher        = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, 1000, fileSystem, new RMsBuildFileSystemFilter());
            _fileWatcher.Error += FileWatcherError;
            Project             = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher);
        }
Пример #7
0
 public ToggleMultilineHistorySelectionCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdToggleMultilineSelection, false)
 {
     _history             = historyProvider.GetAssociatedRHistory(textView);
     _settings            = interactiveWorkflow.Shell.GetService <IRToolsSettings>();
     _interactiveWorkflow = interactiveWorkflow;
 }
Пример #8
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject
            , [ImportMany("Microsoft.VisualStudio.ProjectSystem.Microsoft.VisualStudio.Shell.Interop.IVsProject")] IEnumerable<Lazy<IVsProject>> cpsIVsProjects
            , IProjectLockService projectLockService
            , IRInteractiveWorkflowProvider workflowProvider
            , IInteractiveWindowComponentContainerFactory componentContainerFactory
            , IRToolsSettings toolsSettings
            , IThreadHandling threadHandling
            , ISurveyNewsService surveyNews
            , [Import(AllowDefault = true)] IProjectItemDependencyProvider dependencyProvider
            , ICoreShell coreShell) {

            _unconfiguredProject = unconfiguredProject;
            _cpsIVsProjects = cpsIVsProjects;
            _projectLockService = projectLockService;
            _workflowProvider = workflowProvider;

            _toolsSettings = toolsSettings;
            _threadHandling = threadHandling;
            _surveyNews = surveyNews;
            _dependencyProvider = dependencyProvider;
            _coreShell = coreShell;

            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectRenamedOnWriter += ProjectRenamedOnWriter;
            unconfiguredProject.ProjectUnloading += ProjectUnloading;
            _fileWatcher = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, 1000, _coreShell.Services.FileSystem, new RMsBuildFileSystemFilter(), coreShell.Services.Log);
            _fileWatcher.Error += FileWatcherError;
            Project = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher, _dependencyProvider, coreShell.Services.Log);
        }
Пример #9
0
 public WebBrowserServices(ICoreShell coreShell)
 {
     _coreShell = coreShell;
     _wbs       = _coreShell.GetService <IVsWebBrowsingService>(typeof(SVsWebBrowsingService));
     _ps        = _coreShell.Process();
     _settings  = _coreShell.GetService <IRToolsSettings>();
 }
Пример #10
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 <IRToolsSettings>();
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
Пример #11
0
 public SearchWebForCurrentCommand(
     IRInteractiveWorkflow workflow,
     IActiveWpfTextViewTracker textViewTracker,
     IActiveRInteractiveWindowTracker activeReplTracker) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSearchWebForCurrent,
          workflow, textViewTracker, activeReplTracker, Resources.SearchWebFor)
 {
     _settings = workflow.Shell.GetService <IRToolsSettings>();
 }
Пример #12
0
        public AD7Property(AD7StackFrame stackFrame, IREvaluationResultInfo result, bool isSynthetic = false, bool isFrameEnvironment = false)
        {
            StackFrame         = stackFrame;
            EvaluationResult   = result;
            IsSynthetic        = isSynthetic;
            IsFrameEnvironment = isFrameEnvironment;

            _children     = Lazy.Create(CreateChildren);
            _reprToString = Lazy.Create(GetReprToString);
            _settings     = stackFrame.Engine.Shell.GetService <IRToolsSettings>();
        }
Пример #13
0
        public RProjectLoadHooks(UnconfiguredProject unconfiguredProject, IProjectLockService projectLockService, IRInteractiveWorkflowProvider workflowProvider, IInteractiveWindowComponentContainerFactory componentContainerFactory, IRToolsSettings toolsSettings, IFileSystem fileSystem, IThreadHandling threadHandling) {
            _unconfiguredProject = unconfiguredProject;
            _workflowProvider = workflowProvider;
            _componentContainerFactory = componentContainerFactory;

            _toolsSettings = toolsSettings;
            _fileSystem = fileSystem;
            _threadHandling = threadHandling;
            _projectDirectory = unconfiguredProject.GetProjectDirectory();

            unconfiguredProject.ProjectUnloading += ProjectUnloading;
            _fileWatcher = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, fileSystem, new RMsBuildFileSystemFilter());
            Project = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher);
        }
Пример #14
0
        public VariableView(IRToolsSettings settings) {
            _settings = settings;

            InitializeComponent();

            SortDirection = ListSortDirection.Ascending;

            var variableProvider = VsAppShell.Current.ExportProvider.GetExportedValue<IVariableDataProvider>();

            SetRootNode(EvaluationWrapper.Ellipsis);

            _globalEnvSubscription = variableProvider.Subscribe(0, VariableProvider.GlobalEnvironmentExpression, OnGlobalEnvironmentEvaluation);

            RootTreeGrid.Sorting += RootTreeGrid_Sorting;
        }
Пример #15
0
        public VariableView(IRToolsSettings settings)
        {
            _settings = settings;

            InitializeComponent();

            SortDirection = ListSortDirection.Ascending;

            var variableProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IVariableDataProvider>();

            SetRootNode(EvaluationWrapper.Ellipsis);

            _globalEnvSubscription = variableProvider.Subscribe(0, VariableProvider.GlobalEnvironmentExpression, OnGlobalEnvironmentEvaluation);

            RootTreeGrid.Sorting += RootTreeGrid_Sorting;
        }
Пример #16
0
        public WorkingDirectoryCommand(IRInteractiveWorkflowVisual interactiveWorkflow) :
            base(new[] {
            new CommandId(RGuidList.RCmdSetGuid, RPackageCommandId.icmdGetDirectoryList),
            new CommandId(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSetWorkingDirectory)
        }, false)
        {
            _interactiveWorkflow = interactiveWorkflow;
            _settings            = _interactiveWorkflow.Shell.GetService <IRToolsSettings>();

            _session                   = interactiveWorkflow.RSession;
            _session.Connected        += OnSessionConnected;
            _session.DirectoryChanged += OnCurrentDirectoryChanged;

            if (InitializationTask == null && _session.IsHostRunning)
            {
                InitializationTask = UpdateRUserDirectoryAsync();
            }
        }
Пример #17
0
        public void RunBrowserTest(WebBrowserRole role, Guid guid, string title, IRToolsSettings externalSettings, IRToolsSettings internalSettings) {
            var vswbs = Substitute.For<IVsWebBrowsingService>();
            var ps = Substitute.For<IProcessServices>();

            var wbs = new WebBrowserServices(vswbs, ps, externalSettings);
            wbs.OpenBrowser(role, _url);
            ps.Received().Start(_url);

            ps.ClearReceivedCalls();
            wbs = new WebBrowserServices(vswbs, ps, internalSettings);
            wbs.OpenBrowser(role, _url);

            UIThreadHelper.Instance.DoEvents();
            ps.DidNotReceive().Start(_url);

            IVsWebBrowser vswb;
            IVsWindowFrame frame;
            vswbs.Received().CreateWebBrowser(Arg.Any<uint>(), guid, title, _url, null, out vswb, out frame);
        }
Пример #18
0
        public void RunBrowserTest(WebBrowserRole role, Guid guid, string title, IRToolsSettings externalSettings, IRToolsSettings internalSettings)
        {
            var vswbs = Substitute.For <IVsWebBrowsingService>();
            var ps    = Substitute.For <IProcessServices>();

            var wbs = new WebBrowserServices(vswbs, ps, externalSettings);

            wbs.OpenBrowser(role, _url);
            ps.Received().Start(_url);

            ps.ClearReceivedCalls();
            wbs = new WebBrowserServices(vswbs, ps, internalSettings);
            wbs.OpenBrowser(role, _url);
            ps.DidNotReceive().Start(_url);

            IVsWebBrowser  vswb;
            IVsWindowFrame frame;

            vswbs.Received().CreateWebBrowser(Arg.Any <uint>(), guid, title, _url, null, out vswb, out frame);
        }
Пример #19
0
        public VariableView(IRToolsSettings settings)
        {
            _settings = settings;

            InitializeComponent();

            SetRootNode(EvaluationWrapper.Ellipsis);
            EnvironmentComboBox.ItemsSource   = _defaultEnvironments;
            EnvironmentComboBox.SelectedIndex = 0;

            SortDirection         = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>();

            _rSession = sessionProvider.GetInteractiveWindowRSession();

            _environmentProvider = new REnvironmentProvider(_rSession);
            _environmentProvider.EnvironmentChanged += EnvironmentProvider_EnvironmentChanged;
        }
Пример #20
0
        public VariableView(IRToolsSettings settings)
        {
            _settings = settings;

            InitializeComponent();

            _aggregator = VsAppShell.Current.ExportProvider.GetExportedValue <IObjectDetailsViewerAggregator>();

            SetRootNode(VariableViewModel.Ellipsis);

            SortDirection         = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var sessionProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>();

            _session = sessionProvider.GetInteractiveWindowRSession();

            _environmentProvider            = new REnvironmentProvider(_session);
            EnvironmentComboBox.DataContext = _environmentProvider;
            _environmentProvider.RefreshEnvironmentsAsync().DoNotWait();
        }
Пример #21
0
        public VariableView(IRToolsSettings settings, ICoreShell shell)
        {
            _settings = settings;
            _shell    = shell;

            InitializeComponent();

            _aggregator = _shell.ExportProvider.GetExportedValue <IObjectDetailsViewerAggregator>();

            SetRootNode(VariableViewModel.Ellipsis);

            SortDirection         = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var workflow = _shell.ExportProvider.GetExportedValue <IRInteractiveWorkflowProvider>().GetOrCreate();

            _session = workflow.RSession;

            _environmentProvider            = new REnvironmentProvider(_session);
            EnvironmentComboBox.DataContext = _environmentProvider;
            _environmentProvider.RefreshEnvironmentsAsync().DoNotWait();
        }
Пример #22
0
        public VariableView(IRToolsSettings settings, ICoreShell shell)
        {
            _settings              = settings;
            _shell                 = shell;
            _shell.UIThemeChanged += OnUIThemeChanged;

            InitializeComponent();
            SetImageBackground();

            _aggregator = _shell.GlobalServices.GetService <IObjectDetailsViewerAggregator>();
            SetRootNode(VariableViewModel.Ellipsis);

            SortDirection         = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var workflow = VsAppShell.Current.GlobalServices.GetService <IRInteractiveWorkflowProvider>().GetOrCreate();

            _session = workflow.RSession;

            _environmentProvider            = new REnvironmentProvider(_session, shell.Services.MainThread);
            EnvironmentComboBox.DataContext = _environmentProvider;
            _environmentProvider.RefreshEnvironmentsAsync().DoNotWait();
        }
Пример #23
0
        public VariableView(IRToolsSettings settings, ICoreShell shell) {
            _settings = settings;
            _shell = shell;

            InitializeComponent();

            _aggregator = _shell.ExportProvider.GetExportedValue<IObjectDetailsViewerAggregator>();

            SetRootNode(VariableViewModel.Ellipsis);

            SortDirection = ListSortDirection.Ascending;
            RootTreeGrid.Sorting += RootTreeGrid_Sorting;

            var theme = shell.ExportProvider.GetExportedValue<IThemeUtilities>();
            theme.SetImageBackgroundColor(RootTreeGrid, Brushes.ToolWindowBackgroundColorKey);
            theme.SetThemeScrollBars(RootTreeGrid);

            var workflow = VsAppShell.Current.ExportProvider.GetExportedValue<IRInteractiveWorkflowProvider>().GetOrCreate();
            _session = workflow.RSession;

            _environmentProvider = new REnvironmentProvider(_session, shell.Services.MainThread);
            EnvironmentComboBox.DataContext = _environmentProvider;
            _environmentProvider.RefreshEnvironmentsAsync().DoNotWait();
        }
Пример #24
0
 public VariableNode(IRToolsSettings settings, VariableViewModel evaluation)
 {
     _settings   = settings;
     _evaluation = evaluation;
 }
Пример #25
0
 public VariableNode(IRToolsSettings settings, EvaluationWrapper evaluation) {
     _settings = settings;
     _evaluation = evaluation;
 }
Пример #26
0
 public RToolbar(DTE2 dte2, IRToolsSettings settings) {
     _dte2 = dte2;
     _settings = settings;
 }
Пример #27
0
 public FileEditor(ICoreShell coreShell, IRToolsSettings settings, IVsEditorAdaptersFactoryService adapterService)
 {
     _coreShell      = coreShell;
     _settings       = settings;
     _adapterService = adapterService;
 }
Пример #28
0
 public RToolbar(DTE2 dte2, IRToolsSettings settings)
 {
     _dte2     = dte2;
     _settings = settings;
 }
Пример #29
0
 public SurveyNewsOptions(ICoreShell coreShell)
 {
     _settings = coreShell.GetService <IRToolsSettings>();
 }
Пример #30
0
 public VariableNode(IRToolsSettings settings, VariableViewModel evaluation) {
     _settings = settings;
     _evaluation = evaluation;
 }
Пример #31
0
 public WebBrowserServices(IVsWebBrowsingService wbs, IProcessServices ps, IRToolsSettings settings) {
     _wbs = wbs;
     _ps = ps;
     _settings = settings;
 }
Пример #32
0
 public VariableNode(IRToolsSettings settings, EvaluationWrapper evaluation)
 {
     _settings   = settings;
     _evaluation = evaluation;
 }
Пример #33
0
 public WebBrowserServices(IVsWebBrowsingService wbs, IProcessServices ps, IRToolsSettings settings)
 {
     _wbs      = wbs;
     _ps       = ps;
     _settings = settings;
 }
Пример #34
0
 public SwitchToRClientCommand(IConnectionManager connectionManager, ICoreShell shell, IRToolsSettings settings) :
     base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdSwitchToRClient) {
     _connectionManager = connectionManager;
     _shell = shell;
     _settings = settings;
 }
 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;
 }
Пример #36
0
 public ShowDotPrefixedVariablesCommand(IRToolsSettings settings)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdShowDotPrefixedVariables)
 {
     _settings = settings;
 }
 public ShowDotPrefixedVariablesCommand(IRToolsSettings settings)
     : base(RGuidList.RCmdSetGuid, RPackageCommandId.icmdShowDotPrefixedVariables) {
     _settings = settings;
 }