oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.28k stars 39 forks source link

Fix liveness warnings for __findFile #109

Closed cab404 closed 10 months ago

cab404 commented 11 months ago

Search paths desugar to calling __findFile in Nix.

This fixes warnings in let __findFile = a: b: "hi ${b}!"; in <gilbert>

List parameter is added cause __findFile receives one (with NIXPATH or error thunk). Might be useful for type inference.

I am not sure, if accounting for such a hack is in scope of this lsp, but I've seen it being used and I am using it myself.

cab404 commented 11 months ago

This currently emits «Undefined name» warnings due to __findFile not being in scope. I probably should modify "generated.expr" generation, however I am not sure how to add primops without the use of tty yet