question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`languageserver.formatting_style` in VSCode settings (not only options in `.Rprofile`)

See original GitHub issue

Is your feature request related to a problem? Please describe. I encountered the same issue on Windows as described in REditorSupport/languageserver#503. It is not that trivial to figure out in what directory the “languageserver” was started and put the formatter/.Rprofile in the proper location.

Describe the solution you’d like Is there a way to set this in vscode-r settings (i.e., “r.lsp.formatting_style”)? Maybe like for the knitr command. image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eitsupicommented, Apr 1, 2022

Unfortunately, the home directory on Windows is not the root directory of the user, i.e., C:\Users\mcanouil\Documents for R.

This is really hard to find but I believe it will be changed in R 4.2.0 to be released this month.

It would be way easier to have it in VSCode settings especially for cross platform access (e.g., settings sync) instead of having to create .Rprofile on every local/remote containers/servers/computers.

Wouldn’t languageserver.formatting_style be difficult to represent this in json (VSCode’s configuration file is json, just in case) since this is essentially R code? Instead, it seems to me that it would be better to change the styler’s settings so that they can be defined from the configuration file (r-lib/styler#319) and use those settings. In fact, linting by languageserver uses the lintr’s configuration file (.lintr).

1reaction
mcanouilcommented, Apr 1, 2022

My bad, the issue is from the languageserver repository REditorSupport/languageserver#503

Read more comments on GitHub >

github_iconTop Results From Across the Web

An implementation of the Language Server Protocol for R
The formatting style can be customized by specifying languageserver.formatting_style option which is supposed to be a function that accepts an options argument ...
Read more >
An implementation of the Language Server Protocol for R
The language server uses styler to perform code formatting. It uses styler::tidyverse_style(indent_by = options$tabSize) as the default style where options is ...
Read more >
How to modify the auto-formatting rule in vscode?
The way to customize the formatting style is to add the following code in your ~/.Rprofile : options(languageserver.formatting_style ...
Read more >
An implementation of the Language Server Protocol for R
Server capabilities are defined in capabilities.R. Users could override the settings by specifiying languageserver.server_capabilities option in .Rprofile .
Read more >
One month with R in VS Code - Schiff Consulting
This is not always straightforward as VS Code has a zillion settings and R in ... and some R packages to work, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found