Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Better autocomplete

Open fonsp opened this issue 5 years ago • 16 comments

Sorting autocomplete results:

Right now results are presented in alphabetical (i.e. code index) order. The dream is to have full AI power like kite.com, but perhaps there are some simple improvements to be made first.

  • [x] lowercase first, then uppercase?
  • [x] for Module.<TAB>, first show names that are exported by the module, then the rest. The set of exported names should be everything that you need, and the other names are probably not meant to be used.
  • [x] Show basic type info: is it a function, submodule, ...?
  • [x] Fuzzy search
  • [ ] Autocomplete all words in the same CM - https://codemirror.net/demo/anywordhint.html

Please post other ideas and suggestions!

fonsp avatar Aug 17 '20 13:08 fonsp

Is there a way to use REPL unicode shortcuts (i.e. \sum<tab> --> ∑) in Pluto? If not, would that fit in here?

As an aside, I love the project and I'm interested in contributing, but I've never used Javascript before so I think trying this task would be slow going for me.

cadojo avatar Aug 23 '20 16:08 cadojo

Those already work inside Pluto - is it broken for you? You might need to press TAB twice.

fonsp avatar Aug 24 '20 06:08 fonsp

Great to hear that you want to contribute! If you want to work with Julia instead of JS, then writing sample notebooks might be the most fun. Ideas here and here, I'd be happy to have a video call if you have an idea: [email protected]

fonsp avatar Aug 24 '20 06:08 fonsp

Those already work inside Pluto - is it broken for you? You might need to press TAB twice.

Ah I must have missed it before, it is working for me! Thanks!

writing sample notebooks might be the most fun

I'm about to start my last year of grad school, I'll be taking a few aerospace dynamics courses this semester that might offer opportunities for interesting functional programming examples. I'll see what my classes look like - if an assignment fits, two birds with one stone. If not, I'll add an example or two this semester. I'll send an email with ideas once they're more thought out!

cadojo avatar Aug 25 '20 03:08 cadojo

Nice! i think a functional programming sample could be really useful - Pluto makes more sense when you program in the functional style

fonsp avatar Aug 25 '20 07:08 fonsp

https://github.com/fonsp/Pluto.jl/issues/111#issuecomment-683432200

fonsp avatar Aug 30 '20 15:08 fonsp

I'm not sure what it's called (fuzzy searching maybe?) but the kind of autocomplete where you are shown results that include not just those that begin with the characters you've typed so far.

I.e. like: image

I use this constantly in various IDE's, including VS Code.

pbouffard avatar Oct 22 '20 22:10 pbouffard

I implemented export info and type info in https://github.com/fonsp/Pluto.jl/pull/606

fonsp avatar Oct 23 '20 15:10 fonsp

Possibly of interest: https://github.com/tkf/InteractiveCodeSearch.jl

pbouffard avatar Oct 24 '20 00:10 pbouffard

As for "fuzzy search", we can use FuzzyCompletions.jl as a drop-in replacement of REPLCompletions module (, which is actually a backend completion engine for Juno). @fonsp what do you think on this ? If we want to try this out, I'm welcome to make up a PR.

aviatesk avatar Nov 17 '20 09:11 aviatesk

Interesting, if it is really that easy then your PR would be very welcome!

fonsp avatar Nov 17 '20 11:11 fonsp

Maybe there already is an option for this, but it seems that currently the autocomplete only shows suggestions if you press tab.

In most editors, the autocomplete starts showing suggestions as soon as you start typing, which is a lot more convenient and faster, because you can just type without thinking about autocomplete, and then accept a suggestion if you see the correct one pop up.

FeldrinH avatar Apr 22 '21 11:04 FeldrinH

Thanks @FeldrinH ! We want to enable autocompletion on every keystroke, but I think we should only enable this if our autocomplete is good enough, otherwise users might get frustrated. The big IDEs generally have a scoring mechanism to judge whether a completion is relevant enough to pop up without prompt.

fonsp avatar Apr 22 '21 12:04 fonsp

Would it be possible to list file/directory paths on pressing the tab key first instead of a character that already exists? The workaround was to enter "<some path>/.<TAB>", but I don't think that this seems to work anymore?

This feature has been super handy for navigating around directory trees without needing to look up what files already exist in a separate terminal

icweaver avatar May 27 '21 01:05 icweaver

Coming kind of late to this. But it would be super neat if when autocompleting unicode commands like \eta it displayed the the unicode character in the right column of the autocomplete. Would also be nice for students who might not be as familiar w/ latex equation voodoo.

mkschleg avatar Aug 26 '21 17:08 mkschleg

Does Pluto has autocomplete when typing without press <Tab> at first?

hungpham3112 avatar Jul 24 '22 10:07 hungpham3112