haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.61k stars 351 forks source link

Work out how absolutizing paths should work #4278

Open michaelpj opened 3 weeks ago

michaelpj commented 3 weeks ago

Is your enhancement request related to a problem? Please describe.

We realised in https://github.com/haskell/haskell-language-server/pull/4231 that we don't really know how we are supposed to absolutise paths. We have a few cases:

  1. File paths that come from other tools, e.g. cabal. Probably these need to be relative to our working directory; or ideally we should avoid doing things that depend on our working directory at all.
  2. File paths that come from the client. Probably these need to be relative to a LSP workspace folder, but it's not entirely clear.
    • This is tricky: how do we know which workspace folder to use? Maybe we have to guess from the request? At least it would be nice to have whatever weird heuristic we end up with written down in some code.

It would be nice to tidy this up, but it probably relies on https://github.com/haskell/haskell-language-server/issues/4277 so we can actually tell where this is happening.