Closed pengstrom closed 6 years ago
I have the same problem too though I added a module name to dependencies
in a file, package.yaml
.
Has anybody succeeded to use auto completion with the recent version of HIE in neovim?
@mkYYY I don't think module autocompletion is implemented yet. Other than that, autocompletion on functions and other symbols is working great in a recent neovim installation.
@Bubba @alanz If you can offer me any guidance on this one, I'd love to implement autocomplete for imports
This would be really nice addition, you'll probably want to look into HieExtras.hs
, mainly in these two functions
https://github.com/haskell/haskell-ide-engine/blob/38d27a270ec1a7d7f43faa6763a8062731998633/src/Haskell/Ide/Engine/Plugin/HieExtras.hs#L250-L251
https://github.com/haskell/haskell-ide-engine/blob/38d27a270ec1a7d7f43faa6763a8062731998633/src/Haskell/Ide/Engine/Plugin/HieExtras.hs#L131-L132
But these are kind of "dumb" completions that don't really take into account the position of the cursor. The ModuleCache
instance builds up all the suggestions based off everything in global scope, and getCompletions
filters it down to what matches the word that the cursor is at.
My first guess would be maybe to find and cache the modules that can be imported, and then populate them in getCompletions
whenever you detect that the user has written "import x"
Great, I'll make this a project for the week. Will ask questions if I get stuck
@Bubba is there a place we can chat? I'm stuck in several fronts and could use some guidance
@Lorenzo We're on the #haskell-ide-engine IRC channel on freenode!
When specifying imports
import Data.<cursor>
no modules are suggested. Forcing completions usingctrl+space
gives only local suggestions.Is this not supported?