• @armchair_progamer@programming.devOPM
    link
    fedilink
    3
    edit-2
    7 months ago

    Yes. Unfortunately I’m not very familiar with GHC and HLS internals.

    What I do know is that when GHC is invoked with a certain flag, as it compiles each Haskell file, it generates a .hie file with intermediate data which can be used by IDEs. So HLS (and maybe JetBrains Haskell) works by invoking GHC to parse and type-check the active haskell file, and then queries the .hie file to get diagnostics, symbol lookups, and completions. There’s also a program called hiedb which can query .hie files on the command line.

    Rust’s language server is completely different (salsa.rs). The common detail is that both of them have LLVM IR, but also higher-level IRs, and the compiler passes information in the higher-level IRs to IDEs for completions/lookups/diagnostics/etc. (in Haskell via the generated .hie files)

    • @demesisx
      link
      English
      17 months ago

      Thanks again. 🙏