Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Formatter not using styler?

クローズ
#675 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
r
領域
tooling

調査の方向性

まず、VSCode で R languageserver を介したフォーマットを再現し、同じファイルに対して styler を直接実行した場合の出力と比較します。languageserver のフォーマッターが styler と互換性のある 2 スペースのインデントを使用し、フォーマット後のコードで linter が発生しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I might have something wrong with my config but I can't figure out what. I am using vscode with the R extension using the languageserver. R is configured correctly (I think) such that I can run scripts, view plots, etc. Linting works as well.

Formatting does not seem to run through the styler package as expected.

Here is a file before formatting:

library("tidyverse")

tibble(x = 1:12, y = rnorm(12)) %>%
ggplot(aes(x = x, y = y)) +
geom_point() +
geom_smooth(method = "lm")
c(1,2,3)

And after formatting using the languageserver functionality in vscode (Right click > Format Document):

library("tidyverse")

tibble(x = 1:12, y = rnorm(12)) %>%
    ggplot(aes(x = x, y = y)) +
    geom_point() +
    geom_smooth(method = "lm")
c(1, 2, 3)

As you can see, the lack of spaces in the last line is fixed. However, the indentation is using 4 spaces, not 2 spaces. The linter yells at me because of the wrong number of spaces.

If I use styler directly on the file (i.e. by opening an R terminal, and running the command style_file("/path/to/file.R")), I get the following:

library("tidyverse")

tibble(x = 1:12, y = rnorm(12)) %>%
  ggplot(aes(x = x, y = y)) +
  geom_point() +
  geom_smooth(method = "lm")
c(1, 2, 3)

In this case, the indentation is correct.

Any advice?

主要言語
R
スター
675
フォーク
118
平均マージ
1日 11時間
マージ済み PR(30日)
11

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

REditorSupport/languageserver のほかの issue

REditorSupport/languageserver の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。