haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 212 forks source link

What should be the content of HIE wrapper script? #1673

Open leofisG opened 4 years ago

leofisG commented 4 years ago

Not sure if this is the correct place to ask this. If not please advise.

The README it mentions about that if we have multiple versions of HIE we can set up the HIE wrapper script, however, I am not sure what should be the content of the wrapper script. It will be great if someone can show me an example?

Specifically, I have a Haskell project that I open in VS code the project itself uses the resolver=lts-14.7 which corresponds to the hie-8.6.5. However, if I don't specifically specify in the setting.json to use the hie-8.6.5 instead just say hie then VS code will complain about cannot start the language server. So I currently just set it to hie-8.6.5. But in the future other project might depends on different resolver and I don't want to set the HIE every single time.

And I assume the wrapper script should help me resolve this issue but I am not sure about how to set it up.

fendor commented 4 years ago

Wrapper script is automatically installed with the install script and is called hie-wrapper. You should check if it on the PATH via invoking hie-wrapper! Usually you just have to tell vscode to use the wrapper script but dont specify a custom wrapper path. An example of a potential wrapper script can be seen at https://github.com/haskell/haskell-ide-engine/blob/master/app/HieWrapper.hs, here written in haskell