jaredly / jaredly/reason-language-server
`Error: Unbound module Foo` with one switch, no errors with different switch
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- OCaml
- Sterne
- 649
- Forks
- 85
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
By happenstance, I'd been using ocaml-variants.4.07.1+flambda since before I started using this plugin, and all was well, until I started using ocaml-base-compiler.4.07.1 (i.e. the "regular" switch?) earlier this week. After that change, any references to modules defined within my working directories fails with a squiggly popup reading Error: Unbound module $module_name.
Immediately around the error in the log is this:
<< Making lastDefinitions with type error for file:///home/chas/dev/project/test/testgeom.ml
type error here File "/home/chas/dev/project/_build/.lsp/testgeom__Testgeom.ast", line 1, characters 5-9:
Error: Unbound module Geom
Sending notification {"jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": {"uri": "file:///home/chas/dev/project/test/testgeom.ml", "diagnostics": [{"range": {"start": {"line": 0, "character": 5}, "end": {"line": 0, "character": 9}}, "message": "Error: Unbound module Geom", "severity": 1}]}}
Nothing spectacularly revealing. AFAICT, it's the same message produced by typing something that really doesn't exist open Bzzzzt.
The workaround for me currently is to just use the flambda switch. Perfectly fine of course, but (a) it seems like there's an actual problem here, and (b) I'm actually not using flambda in CI/production because the programs in question actually are faster without it. 🤷♂️
I can reproduce the problem at will with just:
opam switch 4.07
eval $(opam env)
rm -rf _build; dune runtest
…and then restarting the RLS to pick up the .merlin changes.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduzieren Sie mit den aufgeführten opam switch-, eval-, dune runtest- und RLS restart-Befehlen, und untersuchen Sie anschließend die generierten Änderungen an .merlin sowie das RLS-Log im Umfeld von testgeom.ml. Vergleichen Sie die Modulauflösung unter den regulären und den flambda-Switches. Erledigt ist es, wenn Module aus dem Arbeitsverzeichnis unter ocaml-base-compiler.4.07.1 aufgelöst werden, ohne die Diagnose für ein nicht gebundenes Modul.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- ocaml
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100