jaredly / jaredly/reason-language-server

VS Code shows next/ previous errors only display the first line of the error

Open
#220 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

If you press F8 (default key bindings), VSCode shows the inline error information. But it currently only shows the first line.

![image](https://user-images.githubusercontent.com/3049054/50424966-a060d180-08a0-11e9-8efd-26e0a5cd2389.png)

After digging through LSP specs and the debug logs, here is what I found out:

- `textDocument/codeAction` is sent when you press F8. RLS sends full message back but I'm not sure why VSCode only displays the first line

```
Read message
{"jsonrpc":"2.0","id":2179,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/khoa/web/skrm/new/src/Question_handler.re"},"range":{"start":{"line":30,"character":22},"end":{"line":30,"character":22}},"context":{"diagnostics":[{"range":{"start":{"line":30,"character":7},"end":{"line":30,"character":22}},"message":"Error: This expression has type\n (~handleChange: 'a) =>\n ReasonReact.componentSpec(ReasonReact.stateless,\n ReasonReact.stateless,\n ReasonReact.noRetainedProps,\n ReasonReact.noRetainedProps,\n ReasonReact.actionless)\n but an expression was expected of type\n ReasonReact.component('b, 'c, 'd) =\n ReasonReact.componentSpec('b, 'b, 'c, 'c, 'd)","severity":1}]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.0109672546387ms
Sending response {"id": 2179, "jsonrpc": "2.0", "result": null}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the F8 next/previous-error flow in VS Code and inspect the textDocument/codeAction handling described in the logs. Compare the full diagnostic message returned by RLS with what VS Code displays; done means the inline error information shows the complete multiline message rather than only its first line.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.