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; } } }
public static Task InitializeAsync() { RToolsSettings.Current = new TestRToolsSettings(); FunctionIndex.Initialize(); return(FunctionIndex.BuildIndexAsync()); }
public static void Initialize() { FunctionIndex.Initialize(); }
private void PrepareFunctionIndex() { FunctionIndex.Initialize(); FunctionIndex.BuildIndexAsync().Wait(); }