REditorSupport / REditorSupport/languageserver

Hex code '\a0' crashes language server

Open
#661 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce on Windows 10 with R 4.3.3, VS Code 1.87.2, and languageserver 0.3.16 using a file containing '\xa0'. Start with the document_link_reply call in the provided stack trace and compare behavior with an empty file or WSL; done means the language server no longer exits or reports ECONNRESET for this content.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.