Closed keksnicoh closed 4 years ago
Thanks for your suggestion but I don't have control over the order.
The only option is to show only one intention which is in your case
Import liftIO
of module Control.Monad.Reader
when the module is already there.
Hi,
I'm not sure about the best solution here, but it seems plausible to suggest already imported modules over new ones. From the perspective of IntelliJ it seems a bit weird that the same function can be imported from many different modules. But when using libs like mtl, without an IDE, it is useful...
Your approach seems reasonable. I start thinking about what happens if there are different values having the same identifier? Maybe, only suggestions having the same type should be grouped?
import C (a)
import D (f)
b
suggestions
b
of A
(b :: T1)b
of B
(b :: T1)b
of C
(b :: T1)b
of D
(b :: T1)b
of SpaceShip
(b :: T2)might be grouped as
b
of C
(b :: T1)b
of D
(b :: T1)b
of SpaceShip
(b :: T2)I would love to contribute but i got stuck running the plugin locally at the moment. I made a run configuration which builds a new IDE, but unfortunately, the plugin is not available then.
.run/intellij-haskell.run.xml
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IntelliJ Haskell" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType">
<module name="IntelliJ Haskell" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<alternative-path path="$APPLICATION_HOME_DIR$" alternative-path-enabled="true" />
<predefined_log_file enabled="true" id="idea.log" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
any hints what I should change?
I don't understand your approach of running IntelliJ. Please see https://github.com/rikvdkleij/intellij-haskell/blob/master/CONTRIBUTING.md
Should be fixed in beta72
Please reopen if still an issue.
Hi, thank you very much for this tool, it is very useful. Using the import action frequently I have some suggestions for improvements:
Consider the following import
when using the import action (alt+enter) for a function which is not in scope, yet, e.g.
liftIO
, a list of suggestions is presentedliftIO
of moduleControl.Monad.Cont
liftIO
of moduleControl.Monad.Error
liftIO
of moduleControl.Monad.Reader
which is ordered alphanumerically, I guess. It would be super cool if the item
liftIO
of moduleControl.Monad.Reader
would be the first item in the list as there exists an import of
Control.Monad.Reader
in the module already, thusliftIO
would be added likeAs there are many items in the list, this would speed up the dev experience because
Alt+Enter -> Enter
would add theliftIO
to the import list instead ofAlt+Enter->42 times Page Down ->Enter
just an idea :) Best, Nico