vscode-R icon indicating copy to clipboard operation
vscode-R copied to clipboard

warning messages do not indicate which file or line causing issue

Open tansaku opened this issue 3 years ago • 10 comments

Is your feature request related to a problem? Please describe. I'm getting warning messages popping up in the bottom right corner of vscode like this:

The "file" argument must be of type string. Received undefined

in a large R project that I've loaded. What's a little frustrating is that there is no indication of the source file or code line that's causing the problem

Describe the solution you'd like

Either have the warning message include the source location, or if that's not possible then don't pop up a window with the warning message that I have to click close on, and instead just log it somewhere

Additional context

Screenshot 2022-03-14 at 11 55 47

I'm on OSX 12.2.1, VSC 1.65.0 and v2.4.0 of the extension - otherwise very much enjoying the extension - keep up the great work!

tansaku avatar Mar 14 '22 11:03 tansaku

Would you like go "Toggle Developer Tools" and see if there is an error in the console?

renkun-ken avatar Mar 14 '22 12:03 renkun-ken

Does this message appear when you just open the folder and do nothing, or you could trigger this error message somehow?

renkun-ken avatar Mar 14 '22 12:03 renkun-ken

Screenshot 2022-03-14 at 15 06 51

I don't trigger it - it just appears

tansaku avatar Mar 14 '22 15:03 tansaku

Looks like you are using packrat in the project and vscode-R does not seem to work well with it yet. I'll try using it and take a closer look.

renkun-ken avatar Mar 15 '22 01:03 renkun-ken

much appreciated - and yes, packrat in heavy use ... I tried setting r.rpath.mac and restarting VS Code, but still the same errors in dev tools and popups ...

Screenshot 2022-03-15 at 10 21 11

tansaku avatar Mar 15 '22 10:03 tansaku

Screenshot 2022-03-15 at 10 23 11

I also get the above popup repeatedly - I click yes and then get

Screenshot 2022-03-15 at 10 23 43

but I still get the same popup after each re-start

not sure if that's related ...

tansaku avatar Mar 15 '22 10:03 tansaku

one of the wrinkles in the project i'm working on, is that that outer shell is ruby (weird I know) - and then the R code sits in sub-directories, so I wonder if that's screwing with packrat, e.g. when it says it can't load packrat/init.R it's trying to do it from the root working directory rather than the R root which is in /lib/<R-sub-project-name>/versions/

tansaku avatar Mar 15 '22 10:03 tansaku

I am getting this same error with renv, I suppose it is very similar to packrat.

It would be great to be able to use renv/packrat with vscode-R. I have jsonlite and languageserver installed both within the renv library and the system library.

Please let me know if anybody figures something out!

vscode-rror

joelnitta avatar Apr 20 '22 06:04 joelnitta

@joelnitta Would you like to try the latest development build and see if the problem still persists?

renkun-ken avatar Apr 20 '22 07:04 renkun-ken

@renkun-ken Thanks! Actually, another wrinkle is that I am running this in conda... not sure if that is having an effect.

I am trying "option 3" mentioned in #946.

Anyways, it still isn't working for me with the dev build... (the conflicted calls below come from using {conflicted} in my .Rprofile. Apparently that package is working correctly!)

R Language Server (2316699) started
[conflicted] Will prefer contentid::resolve over any other package

[conflicted] Will prefer dplyr::filter over any other package

Error in socketConnection(host = host, port = port, open = "r+b") : 
  cannot open the connection
Calls: <Anonymous> -> <Anonymous> -> initialize -> socketConnection
In addition: Warning message:
In socketConnection(host = host, port = port, open = "r+b") :
  localhost:38029 cannot be opened
Execution halted

R Language Server (2316699) exited with exit code 1
R Language Server (2321619) started
[conflicted] Will prefer contentid::resolve over any other package

[conflicted] Will prefer dplyr::filter over any other package

Error in socketConnection(host = host, port = port, open = "r+b") : 
  cannot open the connection
Calls: <Anonymous> -> <Anonymous> -> initialize -> socketConnection
In addition: Warning message:
In socketConnection(host = host, port = port, open = "r+b") :

  localhost:40569 cannot be opened
Execution halted

R Language Server (2321619) exited with exit code 1

joelnitta avatar Apr 20 '22 08:04 joelnitta

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Apr 21 '23 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 06 '23 01:05 github-actions[bot]