jaredly / jaredly/reason-language-server

Failed to refmt [doesn't work with a lerna monorepo]

Open
#217 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi, I'm having a problem regarding the language server. I have a lerna monorepo setup where the `bsconfig.json` is inside a sub project and the dependencies are hoisted at the parent level.

This is the error from `node_modules/.lsp/debug.log`
```
{"jsonrpc":"2.0","id":4,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///Users/razagill/Development/nugen/shared/src/util/general.re"},"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":1}},"context":{"diagnostics":[]}}}
[server] Got a method textDocument/codeAction
[server] processing took 0.0321865081787ms
Sending response {"id": 4, "jsonrpc": "2.0", "error": {"code": -32603, "message": "Failed to refmt '/Users/razagill/Development/nugen/node_modules/bs-platform/lib/refmt.exe' --print binary --recoverable --parse re > '/Users/razagill/Development/nugen/shared/node_modules/.lsp/General-@nugen/shared.ast'\n/bin/sh: /Users/razagill/Development/nugen/shared/node_modules/.lsp/General-@nugen/shared.ast: No such file or directory"}}
```
`version: 1.4.1`
`os: osx mojave 10.14.2`
`node: 11.0.0`
`bs-platform: 4.0.14`

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

Start with node_modules/.lsp/debug.log and reproduce the textDocument/codeAction request in the reported Lerna layout, with bsconfig.json in the subproject and dependencies hoisted above it. Trace how the refmt command builds its input and output paths. Done means refmt completes for the subproject without the reported missing .ast path error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, 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.