jaredly / jaredly/reason-language-server
Sibling files can't be referred to in subdirectories
- Dominant language
- OCaml
- Stars
- 649
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
With a folder structure so:
```
src\
- folder\
- Foo.re
- Bar.re
```
If I try to refer to a method `fun` in `Bar.re` as `Foo.fun`, the language server shows a red squiggle under it with the error
```
Unbound module Foo
Hint: Did you mean Foo?
```
But if I move the two files into `src\`, the error disappears.
`bsb -make-world` successfully compiles for both scenarios.
Is there a setting I need to have for this to not be an issue?
I don't know if this helps, but here's by `bsconfig.json`
```json
{
"name": "reason-react-examples",
"reason": {
"react-jsx": 3
},
"sources": {
"dir" : "src",
"subdirs" : true
},
"bsc-flags": ["-bs-super-errors", "-bs-no-version-header"],
"package-specs": [{
"module": "es6",
"in-source": false
}],
"suffix": ".bs.js",
"namespace": true,
"bs-dependencies": [
"reason-react"
],
"refmt": 3
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the diagnostic with src/folder/Foo.re and Bar.re using the provided bsconfig.json, then compare it with the successful bsb -make-world result. Start by tracing how the language server resolves sibling modules in subdirectories; done when Foo.fun is accepted without an Unbound module error while the existing build still succeeds.
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
- Mostly clear
- Newbie friendliness
- 35/100