Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: indentation clash (formatter vs lintr)

Đang mở Phù hợp với người mới
#1,883 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@renkun-ken đang làm issue này rồi.

Từ ngày 20/10/2026.

  • #1884 của @renkun-ken — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
92/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
json, r, vscode
Lĩnh vực
developer-experience

Hướng nghiên cứu

Bắt đầu tại configurationDefaults và tìm khối ngôn ngữ [r] hiện có. Thêm kích thước tab mặc định là hai dấu cách bằng thiết lập trình soạn thảo được đề xuất. Hoàn tất khi các tệp R mới được thụt lề hai dấu cách theo mặc định mà không có cảnh báo từ indentation_linter.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
1.2k
Fork
151
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của REditorSupport/vscode-R

Tất cả issue của REditorSupport/vscode-R

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.