rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Is there any way to add dependencies/packages automatically? #543

Closed chansey97 closed 4 years ago

chansey97 commented 4 years ago

For example, when there is a lack of package, the code area will be marked in red, but the packages cannot be imported automatically. I have to modify package.yaml manually. Is there any way to automatically import these packages. (e.g. like Java, click the red line and import that package)

dep

Thanks.

rikvdkleij commented 4 years ago

Thanks for reporting!

No, that's not possible. AFAIK that is not possible with Java.

It's possible to add an import when an identifier can't be found but the package/library should be installed.

chansey97 commented 4 years ago

The inconvenience is that when a package is missing, such as: Data.List.Split, I have to search Google to find its name split and then add it to package.yaml. This must be done for each project.

For current intellij-haskell, is this a good practice or not? Sorry, I am not very familiar with Haskell ecosystem.

rikvdkleij commented 4 years ago

You can use hoogle for searching.

I don't see a simple solution for your request. Also after adding a dependency the project has to be rebuilt and and REPLs have to be restarted.

chansey97 commented 4 years ago

hoogle is good.

Thanks.