Skip to content

Commit 6300c7c

Browse files
Merge pull request #835 from lorenzwalthert/vs-code
- Add link to language server (#835).
2 parents f7cea77 + 270ea25 commit 6300c7c

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616

1717
* Break the line between `%>%` and `{` inside and outside function calls (#825).
1818

19+
* Add language server to third-party integrations vignette (#835).
20+
1921
* improved test setup with fixtures and similar (#798).
2022

23+
2124
# styler 1.5.1
2225

2326
## Alignment detection

touchstone/script.R

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,34 @@ clear_ref_caches()
1313

1414

1515
benchmark_run_ref(
16-
expr_before_benchmark = c("library(styler)", "cache_deactivate()"),
17-
without_cache = 'style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))',
16+
expr_before_benchmark = {
17+
library(styler)
18+
cache_deactivate()
19+
},
20+
without_cache = style_pkg("touchstone/sources/here", filetype = c("R", "rmd")),
1821
n = 30
1922
)
2023

2124
clear_ref_caches()
2225
benchmark_run_ref(
23-
expr_before_benchmark = c("library(styler)", "cache_activate(gert::git_branch())"),
24-
cache_applying = 'style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))',
26+
expr_before_benchmark = {
27+
library(styler)
28+
cache_activate(gert::git_branch())
29+
},
30+
cache_applying = style_pkg("touchstone/sources/here", filetype = c("R", "rmd")),
2531
n = 30
2632
)
2733

2834
clear_ref_caches()
2935
benchmark_run_ref(
30-
expr_before_benchmark = c(
31-
"library(styler)",
32-
"cache_activate(gert::git_branch())"
33-
),
34-
cache_recording = c(
35-
"gert::git_reset_hard(repo = 'touchstone/sources/here')",
36-
'style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))'
37-
),
36+
expr_before_benchmark = {
37+
library(styler)
38+
cache_activate(gert::git_branch())
39+
},
40+
cache_recording = {
41+
gert::git_reset_hard(repo = "touchstone/sources/here")
42+
style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))
43+
},
3844
n = 30
3945
)
4046

vignettes/third-party-integrations.Rmd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,24 @@ styler functionality is available in other tools, most notably
2828
is used. The most convenient way to set this up is via
2929
[`usethis::use_tidy_github_actions()`](https://usethis.r-lib.org/reference/tidyverse.html).
3030

31-
* in `reprex::reprex(..., style = TRUE)` to prettify reprex code before
32-
printing. To permanently use `style = TRUE` without specifying it every time,
33-
you can add the following line to your `.Rprofile` (via
34-
`usethis::edit_r_profile()`): `options(reprex.styler = TRUE)`.
35-
3631
* as a formatter for RMarkdown without modifying the source. This feature is
3732
implemented as a code chunk option in knitr. use `tidy = "styler"` in the
3833
header of a code chunks (e.g.` ```{r name-of-the-chunk, tidy = "styler"} `),
3934
or `knitr::opts_chunk$set(tidy = "styler")` at the top of your RMarkdown
4035
script.
4136

37+
* via the [R language server](https://github.com/REditorSupport/languageserver)
38+
to format your code in VS Code, atom and others.
39+
4240
* As a fixer to the [ale
4341
Plug-in](https://github.com/dense-analysis/ale/pull/2401) for VIM.
4442

43+
* in `reprex::reprex(..., style = TRUE)` to prettify reprex code before
44+
printing. To permanently use `style = TRUE` without specifying it every time,
45+
you can add the following line to your `.Rprofile` (via
46+
`usethis::edit_r_profile()`): `options(reprex.styler = TRUE)`.
47+
48+
4549
* in the *format-all* command for Emacs in
4650
[emacs-format-all-the-code](https://github.com/lassik/emacs-format-all-the-code).
4751

0 commit comments

Comments
 (0)