dhall-lang/vscode-dhall-lsp-server

Handle import external dhall files

AlexKovalevych opened this issue · 2 comments

E.g.:

I have config.dhall and dev.dhall files in the same directory and want to import one from another:

-- dev.dhall
let config = ./config.dhall

in config

dhall-to-yaml preview command from dev.dhall results in error:

↳ ./config.dhall

�Error�: Missing file /home/alex/config.dhall

1:              ./config.dhall
2: 

(stdin):1:14

So it should use relative path, not absolute to $HOME

It seems that the current (prototype) implementation of the preview feature simply calls "dhall-to-yaml" and writes the contents of the currently open dhall file to stdin. Ultimately, I think we should have the LSP backend generate the yaml output, to ensure feature parity with the rest of the language server.

As a workaround we could adjust the working directory when executing "dhall-to-yaml".

Welp, that solved it :)