Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: indentation clash (formatter vs lintr)

未关闭 适合新手
#1,883 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
92/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
json, r, vscode

调研方向

从 configurationDefaults 开始,找到现有的 [r] 语言块。使用提议的编辑器设置,将默认制表符大小设为两个空格。完成的标准是:新建的 R 文件默认采用两个空格缩进,且不会触发 indentation_linter 警告。

由索引模型根据 Issue 内容生成。

描述

bug
Area

Syntax highlighting

Bug description

VS Code indents with 4 spaces by default, and vscode-R doesn't override this for R. However, lintr expects indentation of 2 spaces. This leads to a harmless, but annoying linting markup for any new R file:

Image
Steps to reproduce

Open a new file and type and write some code with indentation, e.g. a function call over multiple lines:

plot(
    1:10
)

Again, the 4 spaces is what gets produced automatically. But lintr will complain that it should only be 2.

 [indentation_linter] Indentation should be 2 spaces but is 4 spaces.
Expected behavior

The indentation behaviour or vscode-R should accord with its default linter. My own preference is for that to be 2 spaces, which is the standard that most R linters follow (incl. lintr, air, etc.)

We could set this part of the r block in configurationDefaults.

"[r]": {
    "editor.tabSize": 2
  }
Environment

vscode-R: 3.2.0
R: 4.6.1

Relevant R package versions
packageVersion('lintr')
[1] ‘3.4.0’
Relevant VS Code settings

Logs and additional context

No response

主要语言
TypeScript
星标
1.2k
派生
151
平均合并
1 天 8 小时
30 天内合并 PR
76

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

REditorSupport/vscode-R 的其他 Issue

查看 REditorSupport/vscode-R 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。