Formatter not using styler?
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
REditorSupport/languageserver のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
REditorSupport/languageserver#776 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
REditorSupport/languageserver#735 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
REditorSupport/languageserver#731 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
REditorSupport/languageserver#730 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
REditorSupport/languageserver#771 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
REditorSupport/languageserver の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
api-sync
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
sportsdataverse/hoopR#220 ·
-
compat
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mlr-org/batchtools#332 · コメント 3 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Open-Systems-Pharmacology/OSPSuite.ParameterIdentification#315 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信