jaredly / jaredly/reason-language-server
`Error: Unbound module Foo` with one switch, no errors with different switch
Nessuno ha ancora preso questa issue.
- Lingua principale
- OCaml
- Stelle
- 649
- Fork
- 85
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci con i comandi indicati opam switch, eval, dune runtest e RLS restart, quindi esamina le modifiche generate a .merlin e il log di RLS nell'area relativa a testgeom.ml. Confronta la risoluzione dei moduli con gli switch regular e flambda. È completato quando i moduli della directory di lavoro vengono risolti con ocaml-base-compiler.4.07.1 senza la diagnostica di modulo non associato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- ocaml
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100