15

screen shot of lintr marking my first character in red

screen shot of another example

i just set up R to work with Jupyter notebooks in vscode but it is marking the first string of my kernels in red.

The message I get is:

Failed to run diagnostics: ! error in callr subprocess
Caused by error:
! Full file exclusions must be character vectors of length 1. items: 1 are not! lintr

if i uninstall languageserver package then it disappears but vscode asks me to reinstall it and then it comes back how do i get rid of this?

Matt Park
  • 151
  • 5
  • Is this discussion relevant? https://github.com/REditorSupport/vscode-R/issues/343 (specifically: nathaneastwood wrote "Ok, so I decided to delete my .lintr file and recreate it. Now it would appear to be working. I know I tried this the other day with no joy so I am wondering if between the reinstallation of lintr and the recreation of the .lintr file it has been solved.") – jared_mamrot Jul 14 '22 at 23:24
  • i tried deleting and using default .lintr files but nothing happened. I'm not sure if i need to put a setting that will remove the red mark or write code differently. is the error message saying that i need to set up exclusions in the .lintr file? – Matt Park Jul 15 '22 at 00:31

2 Answers2

1

Try running the R code below to update the languageserver package to the latest development build:

    install.packages("languageserver", repos = c(
    reditorsupport = "https://reditorsupport.r-universe.dev",
    getOption("repos")
))

see https://github.com/REditorSupport/vscode-R/issues/343 for reference. It seems like this error was fixed via REditorSupport/languageserver#610.

I had this same error and this worked for me.

Daisu
  • 11
  • 5
-1

Could you try to run the R code below:

lintr::use_lintr(type = "tidyverse")

see https://github.com/r-lib/lintr/blob/main/README.md#lintr-file-example for reference. I think it creates a .lintr file that defines a default behaviour for lintr within your project directory.So you might need to run the code above each time you have a new project

CyG
  • 382
  • 1
  • 12