R extension for Visual Studio CodeA Visual Studio Code extension provides support for the R language for R 3.2+. Features include syntax checking, completions, code formatting, formatting as you type, tooltips, linting. Supported platforms
PrerequsitesQuick startOpen the Command Palette (Command+Shift+P on macOS and Ctrl+Shift+P on Windows/Linux) and type 'R:' to see list of available commands and shortcuts. Syntax checkSyntax check is performed as you type or when opening a file. Look for red squiggles. Problems are also reported in the FormattingExtension provides ability to format document or selection. Formatting options are available in the Automatic formatting (as you type)The editor can format code after you type Enter, ; or }. You can control the feature via LintingFunctionality is close to lintr. However, you do not have to run linting explicitly, it happens as you type. By default it is disabled, you can enable it by setting Execute in terminal/source fileUse Shortcuts and snippetsExtension provides shortcuts for You can either type Snippets file can be found in Thanks to @jackbrookes for suggestions and snippets. Remoting and WSLThe extension does work in WSL. However, output windows cannot be displayed since UI does not translate over remote connection. There is limited support for plotting though. Remoting like PlottingPlots typically appear in external R windows. However, there is support for internal Remember though that Terminal window and internal R session are not connected. Executing code in Terminal and then attempting plot the result via internal session won't work. With remote ressions, you can execute code in Terminal, save results into a file, then execute plotting in internal session providing results from the file.
Using custom R executable in terminalYou can set Known issuesR session in the editor does not automatically pick up new packages installed in the terminal. You may have to reload the window for the session to pick up newly installed modules. Troubleshooting.NET Core not found You can bypass .NET Core check by setting
R Interpreter not found Try using Not currently supported
Bug reportsPlease file issues at the project GitHub Disclaimer
|