atom-haskell / ide-haskell

Haskell IDE plugin for Atom editor

Home Page:https://atom.io/packages/ide-haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proposition: Completion panel -> Completion hint near the place we're writting

varosi opened this issue · comments

The idea is got from Visual Studio. It is to show a hint next to the cursor on the second line (instead in a completion panel) with the information in current completion panel so it is closer and eye doesn't have to move down and back to see the information. And the even better will be if it underlines (in the hint) the function parameter which is written at the moment (first, then second, then third, etc.).

Last time there was a discussion on the topic, tooltip thing didn't pan out very well, although in principle doable. I'll have to dig up old discussion to remember why exactly this was implemented the way it was. It's entirely possible it was due to some API limitation that has since been lifted, or due to time constraints.

Dynamically updating the hint as you describe is out of the question though, since frankly, parsing Haskell is notoriously hard in general, and parsing half-written Haskell is even harder -- one has to consider operator fixity, infix function application, higher-order functions and whatnot. Rather hellish when compared to good-old C-like language where you only have several types of parentheses and commas to worry about with function application. And half-written Haskell is not well-formed, so one can't just use general-purpose parser and hope for the best.

One reason for using panel instead of tooltip is to avoid dependency on ide-haskell (since tooltips are handled with ide-haskell, and it's a lot of code, so I'd prefer to avoid duplication). Could probably make that optional though.

I understand. It's just a proposition for better usability.

So I finally implemented something along the lines of what you asked for here, via this autocomplete-plus option:
image
Disabled by default.

If you'd let me know if that's something along the lines of what you expected, that'd be nice.