vscode-R

REditorSupportMIT活跃维护

在 VS Code 里写 R 和 R Markdown 的官方扩展,提供语法高亮、代码补全、片段和交互式运行,省去在编辑器和 R 控制台之间来回切换。

R Extension for Visual Studio Code

v3.4.0发布于 2026-11-09 13:54 UTC1,185star153fork同步于 2026-11-10 11:49 UTC

怎么上手

由 README 提炼,执行前请确认
install.packages("languageserver")
code --install-extension REditorSupport.r
硬件要求按 README 说明

README 未说明硬件要求;需先在本机安装 R(>= 3.4.0),扩展本身运行在 VS Code 1.101.0 或更高版本中

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在 VS Code 里写 R 的官方扩展,提供语言服务、终端交互、数据与图形查看

在 VS Code 里写 R 和 R Markdown 的官方扩展,提供语法高亮、代码补全、片段和交互式运行,省去在编辑器和 R 控制台之间来回切换。

核心能力

  • 基于代码分析的 R 语言服务,支持补全、跳转、诊断与格式化
  • 向 R 终端发送代码并管理多个终端和远程会话
  • 分页可排序筛选的数据查看器,支持 data.frame、Arrow 与 polars
  • 交互式图形查看器,支持 jgd 与 httpgd 后端及静态图回退
  • 支持 R Markdown 分块高亮、执行与预览,并可运行 RStudio 插件

容易踩的坑

需先在系统中安装 R 3.4.0 以上版本,否则扩展无法工作;语言服务依赖单独安装的 languageserver R 包;首次使用会提示安装随扩展捆绑的 sess 包,需确认安装才能正常通信

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v3.4.0
  1. v3.4.0最新正式版2026-11-09 · 2026-11-09 13:54 UTC

    Release v3.4.0

    What's Changed

    Full Changelog: https://github.com/REditorSupport/vscode-R/compare/v3.2.1...v3.4.0

  2. latestDevelopment Buildpre-release2026-11-09 · 2026-11-09 13:48 UTC
    查看更新说明

    Contains the VSIX from the latest verified push to main.

  3. v3.2.22026-10-26 · 2026-10-26 14:38 UTC
    查看更新说明
  4. v3.2.12026-10-24 · 2026-10-24 16:12 UTC
    查看更新说明

    Improvements and bug fixes

    • Accepting a function or method completion that inserts parentheses now opens signature help, respecting editor.parameterHints.enabled. (#1878)
    • Fixed session column completion in grouped and nested pipelines, including native R pipes and magrittr pipes. (#1901)
    • Added an explicit Apply button and Blank option for filtering logical columns in the data viewer, including missing (NA) values.
    • Fixed R Interactive plots disappearing during incremental output updates. (#1888)
    • R Interactive execution timing now includes final output delivery and is retained across reconnects. (#1888)

    Full Changelog: https://github.com/REditorSupport/vscode-R/compare/v3.2.0...v3.2.1

  5. v3.2.02026-10-15 · 2026-10-15 23:14 UTC
    查看更新说明

    Release v3.2.0

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    R Extension for Visual Studio Code

    This VS Code extension provides support for the R programming language, including features such as R language service based on code analysis, interacting with R terminals, viewing data, plots, workspace variables, help pages, managing packages, and working with R Markdown documents. See the wiki for full documentation.

    The R and R Markdown syntaxes are located in a sibling package vscode-R-syntax.

    What's new in 3.0.0

    v3.0.0 is a major release with faster, more reliable R session communication, powered by the sess package. The extension includes sess and prompts to install or update the bundled copy when needed. Missing Imports are installed from the configured R repository. See the changelog for other changes and upgrade notes.

    Quickstart

    1. Install R (>= 3.4.0) on your system. On Windows, we recommend letting the installer write the R path to the registry.

    2. Install the languageserver package from R.

      install.packages("languageserver")
      
    3. Install the stable release of this extension from the VS Code Marketplace or the Open VSX Registry. This release requires VS Code 1.101.0 or later.

      code --install-extension REditorSupport.r
      

      To receive daily development updates, choose Switch to Pre-Release Version on the R extension's page in VS Code. New pre-releases are published to the VS Code Marketplace and Open VSX Registry when main changes and verification passes. Choose Switch to Release Version to return to stable releases. When reporting problems, include the extension version and reproduction steps.

      Alternatively, you can test the latest development version by installing from GitHub:

      The latest pre-release is updated after successful verification of a push to main. Download and install it:

      curl -fsSL -o vscode-R.vsix https://github.com/REditorSupport/vscode-R/releases/download/latest/vscode-R.vsix
      code --install-extension vscode-R.vsix
      
    4. Create an R file and start coding! (Click Yes if prompted to install sess.)

    Recommended extras

    Steps 1–3 above are all that's required to get started with R in VS Code. But we also recommend the following software for a fully optimized R + VS Code experience:

    • Install an interactive plotting backend for a better R graphics experience:

      • jgd: Lightweight JSON graphics device with native vscode-R integration. If it is not installed, vscode-R can offer to install it into a vscode-R-managed library without changing your R libraries.
      • httpgd: SVG-based graphics device served via HTTP and WebSockets.
    • arf: A modern R console with many features: syntax highlighting, multiline editing, vi/emacs keybindings, R version switching, etc. Successor to radian written in Rust.

    • Complementary VS Code extensions:

      • Quarto: the official Quarto plugin for VS Code.
      • VSCode-R-Debugger: enables VS Code's debugging facilities for R scripts.

    For example, assuming that you have installed arf and jgd, your user settings.json might include:

    {
        "r.consolePath": "arf",
        "r.bracketedPaste": true,  // recommended for arf (and radian)
        "r.plot.backend": "jgd"    // "auto" already prefers jgd, then httpgd
    }
    

    Please consult the relevant installation wiki pages for your OS (Windows | macOS | Linux) for more detailed instructions.

    Set r.plot.backend to "native" to use R's configured graphics device without opening the VS Code plot viewer automatically. The "standard" backend continues to display static plots in VS Code.

    Features

    Exploring data

    Call View(x) to open a table. The viewer loads rows on demand and applies column filters and sorting in R across the full table.

    • Columns searches column names, shows or hides matching columns, and pins columns to either edge. Drag entries to reorder them. Row names stay pinned on the left.
    • Filters shows filter inputs below the headers. Press Enter to apply text and number filters; use the filter button for ranges, missing values, or combined conditions. Clear filters removes every column filter, including filters on hidden columns. The toolbar shows the matching and total row counts.
    • Columns fit the available width by default and adapt when the viewer is resized. Size to content sizes the currently displayed cells, up to 480 pixels, and keeps those widths; Fit width switches back to filling the viewer. Manually resized columns retain their widths while the remaining flexible columns share the space. Hover over a cell to see its full value.
    • Repeated View() calls for the same object retain the viewer's sizing mode, column layout, sorting, filters, and page size when the column names, order, and types are unchanged. Refreshed data starts on the first page. Reset view restores fit-width sizing, the default layout, filters, sorting, and configured page size.

    Questions, bug reports, ideas, and contributions

    Persistent R Interactive

    This experimental feature provides native VS Code Interactive windows with independent arf sessions, including adoption of existing arf sessions over Remote SSH. vscode-R installs the bundled pure-R sess snapshot; missing Imports come from the configured R repository. Managed sessions retain streaming output, interruption, rich tables, HTML, and plots; notebook console input and debugger prompts are currently unavailable. See the setup and usage guide for session switching, persistence, rich outputs, and platform requirements.