Closed LukaHorvat closed 7 years ago
Sounds reasonable, and should be relatively straightforward to implement, although that would require ghc-mod-5.6.0.0 or higher (earlier versions don't output constructor-to-type associations)
I'm a bit concerned about using .
as a separator though, since that's technically stealing syntax from module separator, and will end up being somewhat ambiguous. Maybe we could just show type constructors as a suggestions when type is autocompleted in non-type context (i.e. outside of type signature)?
Sounds good though it might make sense to have some kind of a separator that leaves only those constructors in the autocomplete list. Also, how do you imagine the constructors would be indicated in the list?
On Fri, Oct 14, 2016, 7:35 PM Nikolay Yakimov notifications@github.com wrote:
Sounds reasonable, and should be relatively straightforward to implement, although that would require ghc-mod-5.6.0.0 or higher (earlier versions don't output constructor-to-type associations)
I'm a bit concerned about using . as a separator though, since that's technically stealing syntax from module separator, and will end up being somewhat ambiguous. Maybe we could just show type constructors as a suggestions when type is autocompleted in non-type context (i.e. outside of type signature)?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/atom-haskell/autocomplete-haskell/issues/17#issuecomment-253869069, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWnw7NMEzghx_sbP-3M_WWpItsxn55Kks5qz71dgaJpZM4KV5zo .
With my suggestion it would probably something like this (note: Prelude
import is qualified and aliased as P
here):
Could be perhaps have a different marker for constructors?
On Fri, Oct 14, 2016 at 7:47 PM Nikolay Yakimov notifications@github.com wrote:
With my suggestion it would probably something like this (note: Prelude import is qualified and aliased as P here): [image: image] https://cloud.githubusercontent.com/assets/7275622/19397129/33d7c7a4-924f-11e6-8056-f73fb50b13d6.png
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/atom-haskell/autocomplete-haskell/issues/17#issuecomment-253871839, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWnw7p8uKJvKyEbNdF0mtpo_KX2lsH0ks5qz8AcgaJpZM4KV5zo .
That would be a bit complicated, but I'll see what I can do about that.
Awesome man!
On Fri, Oct 14, 2016 at 8:03 PM Nikolay Yakimov notifications@github.com wrote:
That would be a bit complicated, but I'll see what I can do about that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/atom-haskell/autocomplete-haskell/issues/17#issuecomment-253876610, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWnw8GXpnnl8tIWBLZLsDY97y6TUuh7ks5qz8PUgaJpZM4KV5zo .
Okay, something to this effect should be available with haskell-ghc-mod v1.18.0. Note that you need ghc-mod 5.6 or above. Also 1.18.0 shows fully-qualified suggestions along with unqualified/alias-qualified ones and should work for aliased but unqualified imports as well (something that wasn't working before).
Constructors are shown as tags in completion panel -- it's a bit incorrect, possibly, but at least consistent with highlighting:
There are probably some edge cases I missed where this will fail miserably, so feel free to report any bugs.
I believe this would be a very nice feature to have. Not sure how easy it would be to implement.
So when I have a type like
it's hard to remember what it's constructors are called. What I would like is to be able to type
T.
and have an autocomplete list with the constructors. Then when I select one and press enter theT.
part would get replaced by the constructor.If the constructors are a part of a qualified import then the
T.
part would be replaced with a qualified constructor name.