-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to run diagnostics lintr #343
Comments
Do you have any This is also likely that there's something wrong with lintr package working with the document you are editing due to some subtle bugs in lintr triggered by malformed code (e.g. r-lib/lintr#461). In REditorSupport/languageserver#220, we make all such lintr failure explicit or otherwise the diagnostics will be silently no error as the background process ends up in an error without any lintr result. Would you like to reduce your document and find the minimal content that could reproduce such error? |
Just to add that you can see if it is lintr (rather than the vscode extension) by manually calling lintr yourself (from the R console)
|
lint("./R/select.R")
# Error in linters[[linter]](expr) : attempt to apply non-function Interesting. I have a valid |
FYI, I had some issues with the |
If your lintr works with other scripts but this one, it is then most likely to be caused by some lintr bug trying to deal with malformed code. Would you like to try And would you like to experiment by reducing code blocks in |
Ah this is a problem with every file in my package, sorry. It's not just one file playing up, this happens every time I open a .R file, it tries to run |
FYI there were no issues parsing the file, nor any other files. |
Not sure what a solution is but you can disable lintr to suppress the error message I think by setting this setting in your json settings file :
|
@nathaneastwood Would you like to use the following to show the traceback: options(error = function() traceback(3)) and see what happens when you run It looks like your |
Ok, so I decided to delete my I now have another issue where functions defined within my package (and therefore my VSCode workspace) are not being detected.
where |
@nathaneastwood The |
Ah, no problem. Let's close this issue for now then. Thanks very much for all your help. |
Can you provide the settings in your
|
Unfortunately I no longer have access to the laptop I had this issue on, sorry. |
Happens with:
and a jupyter notebook. |
I noticed for R Jupyter notebooks it happens whenever you have a comment that exceeds the gutter size. If you break up the long comments into multiple lines, the errors go away. |
Probably related to #1198 |
But it also shows as I assign any variable: Or just one small comment: It looks in a mess and I just follow the |
Should be fixed via REditorSupport/languageserver#610. |
Thank you! It works very well! If there's anybody find it wrong like me, just try update languageserver package using the latest development build below: install.packages("languageserver", repos = c(
reditorsupport = "https://reditorsupport.r-universe.dev",
getOption("repos")
)) |
I am having the same issue as @cworld1, as in the first variable I declare or the first function I call in a notebook cell, I get This also happens in a .R file, but running I have tried both deleting
|
@matthutchings Would you like to try the latest development version of languageserver via install.packages("languageserver", repos = c(
reditorsupport = "https://reditorsupport.r-universe.dev",
getOption("repos")
)) |
Sorry @renkun-ken, I should have mentioned that I have already tried installing the latest dev version. |
After installing the latest version of the language server, I am still having this issue: I'm running r in a jupyter notebook on a VS Code dev container.
|
I tried. It resolves the issue
I had when working with Jupyter Notebooks in Code. Environment:
👉 Issue can be reproduced at https://demo.jupyter.b-data.ch and is resolved by installing the version from R-universe at user level. @renkun-ken Will there soon be an updated version on CRAN or should I install from R-universe until further notice? |
I'm still affected by this issue using rev 1e71561a41ef59126273f16bbb466c0b30a2aa64 with a Windows VSCode and Linux Jupyter Lab server. |
@renkun-ken I want to mention the same error happens to me when I browsing GIt diff of a file in VSCode UI. |
If you have issues with .linter file not being recognised, what works for me is:
|
I have solved this issue by adding .R.git files to the files exclusions. To do so you have to follow the next steps:
This is how it looks: You can add the following lines to your settings.json file, and will have the same results.
|
Describe the bug
I couldn't decide if this was a
languageserver
issue or not, sorry. Every time I open a new file, the top line shows the errorFailed to run diagnostics: lintr
.Expected behavior
I expect the files lints to be correctly checked and any issues display in the problems tab.
Environment (please complete the following information):
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.4.0
Additional context
I see the following in the diagnostics but I am not sure if it is related.
I know this is all very vague, please let me know if you need any additional information.
The text was updated successfully, but these errors were encountered: