23

In the picture below you can see a lot of linting-highlights e.g "Lines should not be more than 80 characters".

I'm trying to disable/modify these but I cannot figure out how. Using this guide I cannot find the path Tools > Options > Text Editor > R > Lint.

How do we change/disable this "help"?

Note, I'm using the R-extension by Yuki Ueda

enter image description here

CutePoison
  • 4,679
  • 5
  • 28
  • 63

2 Answers2

21

You might want to disable linting by setting the vscode setting "r.lsp.diagnostics": false.

Or you might want to customize the list of linters to be used by editing ~/.lintr to effect globally or {workspaceFolder}/.lintr to effect project-wise. Read https://lintr.r-lib.org/articles/lintr.html#configuring-linters for the details of the lintr config file.

Kun Ren
  • 4,715
  • 3
  • 35
  • 50
  • 3
    Had a similar issue to the OP - disabling diagnostics turned off several other useful features for me so I didn't go with this approach. But editing `.lintr` file worked great. – jay Nov 20 '21 at 20:21
  • 1
    Thanks @sindri_baldur, the link is fixed. – Kun Ren May 31 '22 at 18:07
  • 1
    can someone help to get rid of linters globally (for R files in vscodes) using `lintr`? thanks – Cina Aug 02 '22 at 05:36
  • 4
    This solution no longer seems to be enough (since few days ago). – s_baldur Sep 09 '22 at 14:45
  • Maybe it is related to the latest release of vscode-R with vscode-languageclient upgraded to 8.0.2. But I cannot reproduce it. – Kun Ren Sep 10 '22 at 16:51
  • 1
    @sindri_baldur, I experience the same. There is also a [GitHub issue](https://github.com/REditorSupport/languageserver/issues/570) on the matter. – Mihai Sep 12 '22 at 07:52
-3

This can happen if the file is not save with a .R file name extension, including if you're editing a file that has not been saved.

When saving the file, test saving as different extensions and see if that solves it.

If this does not solve it, try disabling the R-extension and reloading to confirm that R-extension is causing the problem.

Stenemo
  • 611
  • 7
  • 13