languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Hex code '\a0' crashes language server

Open ManuelHentschel opened this issue 1 year ago • 3 comments

Setup:

  • windows 10
  • vscode v1.87.2
  • R v4.3.3
  • languageserver v0.3.16 (installed from GitHub)

Workspace containing a single file named "test.R" with content:

'\xa0'

Error: Having this file open and reloading the vscode windows produces the following Error messages: "Connection to server got closed. Server will not be restarted." (Source: R) "Client R Language Server: connection to server is erroring. read ECONNRESET" (Source: R)

R Language Server output channel contains:

R Language Server (11948) started
R library paths: C:/Users/Manuel/AppData/Local/R/win-library/4.3
C:/Program Files/R/R-4.3.3/library

[2024-03-25 10:19:25.933] Error: file name conversion problem -- name too long?
Call: file.exists(str_texts)
Stack trace:
1: file.exists(str_texts)
2: with_wd(rootPath, file.exists(str_texts) & !dir.exists(str_texts))
3: document_link_reply(id, uri, self$workspace, document, rootPath)
4: handler(self, item$id, item$params)
5: parse_callback(self, uri, version, result)
6: private$callback(result)
7: task$check()
8: self$parse_task_manager$check_tasks()
9: self$process_events()

[2024-03-25 10:19:25.935] exiting

[Error - 10:19:25 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 10:19:25 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 10:19:25 AM] Connection to server got closed. Server will not be restarted.
R Language Server (11948) exited with exit code nul

Notes: I could not reproduce using wsl. The file name does not seem to be the issue, the error does not occur with different file contents. If I start with an empty file and add the text '\xa0', the languageserver usually does not crash and features like Go to Definition work on the following:

s <- '\xa0'

s

ManuelHentschel avatar Mar 25 '24 09:03 ManuelHentschel

I'm getting the same (or only similar error, but with a different cause: image

[2024-07-22 11:49:52.050] Error: cannot change working directory
Call: setwd(wd)
Stack trace:
1: setwd(wd)
2: with_wd(rootPath, file.exists(str_texts) & !dir.exists(str_texts))
3: document_link_reply(id, uri, self$workspace, document, rootPath)
4: handler(self, item$id, item$params)
5: parse_callback(self, uri, version, result)
6: private$callback(result)
7: task$check()
8: self$parse_task_manager$check_tasks()
9: self$process_events()
[2024-07-22 11:49:52.053] exiting

[Error - 11:49:53 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 11:49:53 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 11:49:53 AM] Connection to server got closed. Server will not be restarted.
R Language Server (5788) exited with exit code null

From the second step of the stack trace onwards, it's almost identical.

VSCode About:

Version: 1.90.2 (system setup)
Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
Date: 2024-06-18T22:34:26.404Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

I hope there's something to be done? Any help appreciated.

ElijahElliotP avatar Jul 22 '24 17:07 ElijahElliotP

+1

Just having "T\x81rkiye" uncommented in my script crashes R language server which is used for linting (VS code + R extension)

Client R Language Server: connection to server is erroring. read ECONNRESET

The exact line is: mutate(ISO3 = recode(ISO3, "T\x81rkiye" = "Türkiye"))

R Language Server (8704) started
R library paths: C:/Users/xxx/scoop/persist/r/site-library
C:/Users/xxx/scoop/apps/r/4.3.2/library

Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 

Registered S3 method overwritten by 'geojsonsf':
  method        from   
  print.geojson geojson

[2025-02-24 11:42:54.011] Error: file name conversion problem -- name too long?
Call: file.exists(str_texts)
Stack trace:
1: file.exists(str_texts)
2: with_wd(rootPath, file.exists(str_texts) & !dir.exists(str_texts))
3: document_link_reply(id, uri, self$workspace, document, rootPath)
4: handler(self, item$id, item$params)
5: parse_callback(self, uri, version, result)
6: private$callback(result)
7: task$check()
8: self$parse_task_manager$check_tasks()
9: self$process_events()
[2025-02-24 11:42:54.013] exiting

[Error - 11:42:54 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 11:42:54 AM] Client R Language Server: connection to server is erroring.
read ECONNRESET
[Error - 11:42:54 AM] Connection to server got closed. Server will not be restarted.
R Language Server (8704) exited with exit code null

mathiasleroy avatar Feb 24 '25 10:02 mathiasleroy

+1 I think that's basically #640 . I get the same message. Would be great to find a solution for this!

johnroxton avatar Feb 25 '25 10:02 johnroxton