jaredly / jaredly/reason-language-server

Bsb native backend detected as "js" (should be "native")

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

Description

When using the lang server while working with [genType](https://github.com/cristianoc/genType), which has [this](https://github.com/cristianoc/genType/blob/31dbddddd9a84d3d04ffe1e6582220c86501230c/bsconfig.json) `bsconfig.json`, it seems the server is looking for cmt files in `/lib/js`. This breaks most of the features and triggers a lot of "Unbound module X" errors.

Relevant log messages:

```
>> Build system: /Users/javi/Development/github/genType/node_modules/bsb-native/lib/bsb.exe -make-world -backend js

>> Error
Error: Could not find an item in the entries field to compile to 'js'

....

Bad source file (no cmt/cmi) /Users/javi/Development/github/genType/lib/bs/js/src/Dependencies
Bad source file (extension) /Users/javi/Development/github/genType/src/ImportPath.rei
Bad source file (no cmt/cmti/cmi) /Users/javi/Development/github/genType/lib/bs/js/src/ImportPath
Bad source file (no cmt/cmti/cmi) /Users/javi/Development/github/genType/lib/bs/js/src/EmitTyp
Bad source file (no cmt/cmi) /Users/javi/Development/github/genType/lib/bs/js/src/GenType
Bad source file (extension) /Users/javi/Development/github/genType/src/EmitTyp.rei

....
```

cc @bsansouci

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the genType bsconfig.json and the logged bsb-native invocation using `-backend js`; compare that selection with the expected native backend. Trace where the language server determines the build backend and inspect the reported `/lib/bs/js` paths. Done means native projects are detected as native and the language server no longer reports the shown missing cmt/cmi and unbound-module errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.