示例#1
0
        public void ReportWindowLayout()
        {
            var  svc   = new TelemetryTestService();
            var  shell = new VsUiShellMock();
            Guid g     = new Guid("6B72640E-99F8-40A5-BCDB-BB8CF250A1B5");
            Guid p1    = new Guid("E5815AEF-4D98-4BC4-84A0-5DF62ED0755D");
            Guid p2    = new Guid("22130C87-7D87-4C41-9BC0-14BFA3261DA8");
            Guid p3    = new Guid("B7AF6C09-BC6F-41F1-AF1A-B67D267F1C0E");

            IVsWindowFrame frame;

            shell.CreateToolWindow(0, 1, null, ref g, ref p1, ref g, null, "Window#1", null, out frame);
            shell.CreateToolWindow(0, 2, null, ref g, ref p2, ref g, null, "Window#2", null, out frame);
            shell.CreateToolWindow(0, 3, null, ref g, ref p3, ref g, null, "Window#3", null, out frame);

            string log;

            using (var t = new RtvsTelemetry(_packageIndex, svc)) {
                t.ReportWindowLayout(shell);
                log = svc.SessionLog;
            }

            log.Length.Should().BeGreaterThan(0);
            log.Should().Contain("Window#1");
            log.Should().Contain("Window#2");
            log.Should().Contain("Window#3");
            log.Should().Contain("100");
        }
示例#2
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            using (var p = Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p?.LoadSettings();
            }

            RtvsTelemetry.Initialize(_packageIndex, VsAppShell.Current.ExportProvider.GetExportedValue <IRSettings>());
            base.Initialize();

            ProjectIconProvider.LoadProjectImages();
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            BuildFunctionIndex();
            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache), VsAppShell.Current);
            IdleTimeAction.Create(() => RtvsTelemetry.Current.ReportConfiguration(), 5000, typeof(RtvsTelemetry), VsAppShell.Current);
        }
示例#3
0
        public void ReportSettings()
        {
            var    svc = new TelemetryTestService();
            string log;

            using (var t = new RtvsTelemetry(_packageIndex, svc)) {
                t.ReportSettings();
                log = svc.SessionLog;
            }

            log.Length.Should().BeGreaterThan(0);
            log.Should().Contain("Cran");
            log.Should().Contain("LoadRData");
            log.Should().Contain("SaveRData");
            log.Should().Contain("RCommandLineArguments");
            log.Should().Contain("MultilineHistorySelection");
            log.Should().Contain("AlwaysSaveHistory");
            log.Should().Contain("AutoFormat");
            log.Should().Contain("CommitOnEnter");
            log.Should().Contain("CommitOnSpace");
            log.Should().Contain("FormatOnPaste");
            log.Should().Contain("SendToReplOnCtrlEnter");
            log.Should().Contain("ShowCompletionOnFirstChar");
            log.Should().Contain("SignatureHelpEnabled");
            log.Should().Contain("CompletionEnabled");
            log.Should().Contain("SyntaxCheckInRepl");
            log.Should().Contain("PartialArgumentNameMatch");
        }
示例#4
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            CranMirrorList.Download();
            base.Initialize();

            _fs = Services.FileSystem();

            ProjectIconProvider.LoadProjectImages(Services);
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            LoadEditorSettings();
            BuildFunctionIndex();
            AddConnectionStatusBar();
            RtvsTelemetry.Initialize(_packageIndex, Services);

            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());
            ExpansionsCache.Load(Services);
        }
示例#5
0
        protected override void Initialize()
        {
            Current = this;

            VsAppShell.EnsureInitialized();
            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            base.Initialize();

            ProjectIconProvider.LoadProjectImages(VsAppShell.Current.Services);
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            var settings       = VsAppShell.Current.GetService <IRToolsSettings>();
            var editorSettings = VsAppShell.Current.GetService <IREditorSettings>();

            RtvsTelemetry.Initialize(_packageIndex, settings, editorSettings);

            BuildFunctionIndex();
            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());
            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache), VsAppShell.Current);
        }
示例#6
0
        public void ReportConfiguration()
        {
            var    svc = new TelemetryTestService();
            string log;

            using (var t = new RtvsTelemetry(_packageIndex, svc)) {
                t.ReportConfiguration();
                log = svc.SessionLog;
            }

            log.Length.Should().BeGreaterThan(0);
            log.Should().Contain(TelemetryTestService.EventNamePrefixString);
            log.Should().Contain(RtvsTelemetry.ConfigurationEvents.RPackages);
        }
示例#7
0
        public void ReportSettings()
        {
            var    svc = new TelemetryTestService();
            string log;

            using (var t = new RtvsTelemetry(_packageIndex, new RSettingsStub(), _editorSettings, _markdownSettings, svc)) {
                t.ReportSettings();
                log = svc.SessionLog;
            }

            log.Length.Should().BeGreaterThan(0);
            log.Should().Contain("Cran");
            log.Should().Contain("LoadRData");
            log.Should().Contain("SaveRData");
            log.Should().Contain("RCommandLineArguments");
            log.Should().Contain("MultilineHistorySelection");
            log.Should().Contain("AlwaysSaveHistory");
            log.Should().Contain("AutoFormat");
            log.Should().Contain("CommitOnEnter");
            log.Should().Contain("CommitOnSpace");
            log.Should().Contain("FormatOnPaste");
            log.Should().Contain("ShowCompletionOnFirstChar");
            log.Should().Contain("SignatureHelpEnabled");
            log.Should().Contain("CompletionEnabled");
            log.Should().Contain("SyntaxCheckInRepl");
            log.Should().Contain("LinterEnabled");
            log.Should().Contain("LinterCamelCase");
            log.Should().Contain("LinterPascalCase");
            log.Should().Contain("LinterSnakeCase");
            log.Should().Contain("LinterUpperCase");
            log.Should().Contain("LinterSemicolons");
            log.Should().Contain("LinterMultipleDots");
            log.Should().Contain("LinterMultipleStatements");
            log.Should().Contain("LinterNameLength");
            log.Should().Contain("LinterMaxNameLength");
            log.Should().Contain("LinterAssignmentType");
            log.Should().Contain("LinterSpaceAroundComma");
            log.Should().Contain("LinterSpaceBeforeOpenBrace");
            log.Should().Contain("LinterSpacesAroundOperators");
            log.Should().Contain("LinterSpacesInsideParenthesis");
            log.Should().Contain("LinterCloseCurlySeparateLine");
            log.Should().Contain("LinterNoSpaceAfterFunctionName");
            log.Should().Contain("LinterOpenCurlyPosition");
            log.Should().Contain("LinterNoTabs");
            log.Should().Contain("LinterTrailingWhitespace");
            log.Should().Contain("LinterTrailingBlankLines");
            log.Should().Contain("LinterDoubleQuotes");
            log.Should().Contain("LinterLineLength");
            log.Should().Contain("LinterMaxLineLength");
        }
示例#8
0
        protected override void Initialize()
        {
            Current = this;

            // Force app shell creation before everything else
            var shell = VsAppShell.Current;

            if (IsCommandLineMode())
            {
                return;
            }

            VsWpfOverrides.Apply();
            CranMirrorList.Download();

            RtvsTelemetry.Initialize();

            using (var p = Current.GetDialogPage(typeof(RToolsOptionsPage)) as RToolsOptionsPage) {
                p.LoadSettings();
            }

            MicrosoftRClient.CheckInstall(VsAppShell.Current);
            base.Initialize();

            ProjectIconProvider.LoadProjectImages();
            LogCleanup.DeleteLogsAsync(DiagnosticLogs.DaysToRetain);

            _indexBuildingTask = FunctionIndex.BuildIndexAsync();

            AdviseExportedWindowFrameEvents <ActiveWpfTextViewTracker>();
            AdviseExportedWindowFrameEvents <VsActiveRInteractiveWindowTracker>();
            AdviseExportedDebuggerEvents <VsDebuggerModeTracker>();

            System.Threading.Tasks.Task.Run(() => RtvsTelemetry.Current.ReportConfiguration());

            IdleTimeAction.Create(ExpansionsCache.Load, 200, typeof(ExpansionsCache));
        }