atom-haskell-archive / autocomplete-haskell

Atom autocomplete-plus provider for haskell
https://atom.io/packages/autocomplete-haskell
MIT License
23 stars 1 forks source link

Signature hints for explicit imports? #11

Closed ches closed 8 years ago

ches commented 8 years ago

Hi, thanks for this plugin!

I notice that when explicit functions, type constructors, etc. are imported from a module, their signatures do not get hinted in completions (presumably completions are only coming via the default symbol provider), and also alternate constructors are not available for completion.

I know that symbols defined in the file (or even the whole project package, I think) are not currently supported by ghc-mod, but I believe imports should be able to work, based on experience using ghcmod-vim…

For example, if I have a file with this import:

import System.Exit (ExitCode(..), exitWith)

autocomplete-haskell doesn't complete exitWith, or the ExitCode constructors for ExitSuccess and ExitFailure, but in ghcmod-vim these work.

I'm a complete newb with Atom plugin APIs, but if I can help to figure out anything with ghc-mod itself or how ghcmod-vim is doing this, I'll try. ghcmod-vim isn't showing me completions for anything that isn't explicitly imported from System.Exit, like exitSuccess, so I assume it isn't cheating and querying the entire module to populate candidates.

lierdakil commented 8 years ago

This should work. I think (..) might mess up my carefully crafted regexes. I'll take a look.

lierdakil commented 8 years ago

Okay, so I know how to fix explicitly imported exitWith. I have no idea on how to deal with (..) at the moment. Any insight you can offer is welcome.

lierdakil commented 8 years ago

Okay, so long story short, (..) imports won't pull everything until probably ghc-mod 5.6 due to insufficient information in browse output. I did, however, fix parsing. So yeah.

lierdakil commented 8 years ago

Works with ghc-mod-5.6.0.0