jaredly / jaredly/reason-language-server

Spontaneous error "Illegal character (\\r)"

Open
#340 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I've been getting the following errors spontaneously during development: `Illegal character (\\r)`. Simply re-saving the file makes the errors go away, but they reappear in (apparently) random files at (apparently) random points of time. I have also made a hexdump of the file before and after re-saving, and there is no change - so I am guessing there is no real issue with the file itself.

I am on Mac OSXMojave (10.14.6) and getting these errors on two different computers.

![image](https://user-images.githubusercontent.com/5010901/66277193-54b16e80-e89b-11e9-8826-1745004ba23e.png)

Not sure how much of the log is relevant, but here is the part with the "Error: Illegal character":

```
<< Replacing lastDefinitions for file:///.../AddResult.re
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": {"uri": "file:///.../AddResult.re", "diagnostics": []}}
Read message
{"jsonrpc":"2.0","id":805,"method":"textDocument/codeAction",
"params":{"textDocument":
{"uri":"file:///.../AddResult.re"},
"range":{"start":{"line":165,"character":2},
"end":{"line":165,"character":2}},
"context":{"diagnostics":[
{"range":{"start":
{"line":165,"character":2},
"end":{"line":165,"character":3}},
"message":"Error: Illegal character (\\r)","severity":1}]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.00619888305664ms
Sending response {"id": 805, "jsonrpc": "2.0", "result": null}
Read message
```

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

The issue names no source file, test, or entry point. Start by reproducing the intermittent `Illegal character (\r)` diagnostic and inspect the logged `textDocument/codeAction` request; done means the cause is identified and the diagnostic no longer appears spuriously.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.