wende / autocomplete-elixir

Intelligent Elixir autocompletion provider for Atom autocomplete-plus
MIT License
42 stars 11 forks source link

Any plans to add tooltip on mouse over or keyboard shortcut to display help under the caret? #16

Open 7sharp9 opened 9 years ago

7sharp9 commented 9 years ago

This would be really nice.

e.g: screen shot 2015-06-26 at 18 02 48

wende commented 9 years ago

Thought about it. The problem is where to fit it in

7sharp9 commented 9 years ago

You would have to parse the ident under the caret/mouse back to the module and function and then use Code.get_doc(Enum, :docs) then filter that to the function name atom. A quick hack up would be something like:

Code.get_doc(Enum, :docs)
|>Enum.filter_map(&match?({{:filter_map, _}, _, _, _, _}, &1), fn ({_,_,_,_,doc}) -> doc end)

That excludes arity in the filter I think though.

7sharp9 commented 9 years ago

You could pin the current doc help as a notify popup like the scope cursor ALT META P screen shot 2015-06-26 at 18 25 27

wende commented 9 years ago

I know how to do that, but I'm more concerned about the usability. I think users won't like it in a popup. At least I wouldn't.

By the way feel free to modify and make pull requests. I'm open to collaboration :D

7sharp9 commented 9 years ago

Ok cool, see what I can do, need to look at what you have and get familiar first :-)

On 26 Jun 2015, at 18:36, Krzysztof Wende notifications@github.com wrote:

I know how to do that, but I'm more concerned about the usability. I think users won't like it in a popup. At least I wouldn't.

By the way feel free to modify and make pull requests. I'm open to collaboration :D

— Reply to this email directly or view it on GitHub.

wende commented 9 years ago

Autocomplete-plus has something called description field in suggestion. It could fit in there I guess, but I can't get it to work. It just won't display https://github.com/atom/autocomplete-plus/wiki/Provider-API

7sharp9 commented 9 years ago

Hmm, I see what you mean descriptionMoreURL is also available, I wonder why its not displayed.

wende commented 9 years ago

Sorry. Closed the wrong issue

7sharp9 commented 9 years ago

@iraasta Maybe the description field failing to display is due to the RSenseProviders recent depreciations. I have another piece of code using autocompleteplus which returns a promise, If I set the description there then it displays. Incidentally thats whats used by the Haskell autocomplete plus provider and the typescript provider too,

7sharp9 commented 9 years ago

Yep it looks like description is shown when the deprecated properties are adjusted.

Currently spec is empty so nothing is displayed at the bottom, is you switch the ordering so ret is first it is also displayed:

screen shot 2015-06-28 at 18 28 39

Although Its hard to see the list() at the bottom because of my dark theme :-)

wende commented 9 years ago

I see. So how should I make it work? And do You think there's enough place for docs in there? I tried the notifications. This blinking drived me crazy ;)

7sharp9 commented 9 years ago

Best way to see is to hack it together I suppose, how could I easily add the doctext to autocomplete.exs?

Im still getting to grips with the code there.