ghcide executable needs to be compiled with the same matching GHC version.There's missing automation to connect 1 and 2
Create thin ghcide-wrapper that runs hie-bios to get the compiler version and then execute ghcide-X.X.X
I suspect users using Nix, Stack or other would all want different versions of this. If you think it's automatable generically, I'd be keen to understand the underlying ideas. We also aren't going to be able to support multiple-project file trees, as there's no guarantee they run on the same version. I agree it's super useful to get it right, but without having something do LSP forwarding and merging, I'm not sure it can be done robustly.
Wanting to use ghcide on different projects that use different GHC versions might be the most common use case for the program. So I definitely think we should make it as smooth as possible.
In the long run I think that means recommending that end users don't install a single ghcide, but instead use some kind of script that appends the GHC version that ghcide was installed with. Eg ghcide-8.6.5 or ghcide-8.4.4. For instance haskell-code-explorer has an install.hs script for this purpose.
That would help with both the ghcide-wrapper @domenkozar suggested, or with any other wrapper strategy we came up with. For instance I have a friend who wrote a shell script called ghcide, which checks for a .ghcide file in the project where it reads the name of the actual ghcide to run, either ghcide-8.4.4 or ghcide-8.6.5.
I don't have a preference between wrapper strategies, but I think whichever we choose will be helped by a convention that people install multiple ghcides, each with the GHC version appended.
I think this will be done by https://github.com/haskell/haskell-language-server since it was a feature of haskell-ide-engine. I think it's already present there.
Most helpful comment
Wanting to use
ghcideon different projects that use different GHC versions might be the most common use case for the program. So I definitely think we should make it as smooth as possible.In the long run I think that means recommending that end users don't install a single
ghcide, but instead use some kind of script that appends the GHC version thatghcidewas installed with. Egghcide-8.6.5orghcide-8.4.4. For instance haskell-code-explorer has an install.hs script for this purpose.That would help with both the
ghcide-wrapper@domenkozar suggested, or with any other wrapper strategy we came up with. For instance I have a friend who wrote a shell script calledghcide, which checks for a.ghcidefile in the project where it reads the name of the actualghcideto run, eitherghcide-8.4.4orghcide-8.6.5.I don't have a preference between wrapper strategies, but I think whichever we choose will be helped by a convention that people install multiple
ghcides, each with the GHC version appended.