示例#1
0
        public void RSignature()
        {
            using (var script = new TestScript("```{r}\r\n\r\n```", MdContentTypeDefinition.ContentType)) {
                FunctionRdDataProvider.HostStartTimeout = 10000;
                using (new RHostScript(EditorShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>())) {
                    FunctionIndex.Initialize();
                    FunctionIndex.BuildIndexAsync().Wait();
                    FunctionIndexUtility.GetFunctionInfoAsync("lm").Wait(3000);

                    script.MoveDown();
                    script.Type("x <- lm(");
                    script.DoIdle(2000);

                    ISignatureHelpSession session = script.GetSignatureSession();
                    session.Should().NotBeNull();
                    IParameter parameter = session.SelectedSignature.CurrentParameter;
                    parameter.Should().NotBeNull();
                    parameter.Name.Should().Be("formula");

                    script.Type("sub");
                    script.DoIdle(500);
                    script.Type("{TAB}");
                    script.DoIdle(1000);

                    parameter = session.SelectedSignature.CurrentParameter;
                    parameter.Name.Should().Be("subset");

                    string actual = script.EditorText;
                    actual.Should().Be("```{r}\r\nx <- lm(subset = )\r\n```");

                    session   = script.GetSignatureSession();
                    parameter = session.SelectedSignature.CurrentParameter;
                }
            }
        }
示例#2
0
        public async Task InitializeAsync()
        {
            await Workflow.RSessions.TrySwitchBrokerAsync(GetType().Name);

            await PackageIndex.BuildIndexAsync();

            await FunctionIndex.BuildIndexAsync();
        }
示例#3
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));
        }
示例#4
0
 public static Task InitializeAsync()
 {
     RToolsSettings.Current = new TestRToolsSettings();
     FunctionIndex.Initialize();
     return(FunctionIndex.BuildIndexAsync());
 }
示例#5
0
 private void PrepareFunctionIndex()
 {
     FunctionIndex.Initialize();
     FunctionIndex.BuildIndexAsync().Wait();
 }