Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better autocomplete #302

Closed
5 tasks done
fonsp opened this issue Aug 17, 2020 · 17 comments · May be fixed by #2389
Closed
5 tasks done

Better autocomplete #302

fonsp opened this issue Aug 17, 2020 · 17 comments · May be fixed by #2389
Labels
autocomplete <TAB> good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!

Comments

@fonsp
Copy link
Owner

fonsp commented Aug 17, 2020

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.

  • lowercase first, then uppercase?
  • 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.
  • Show basic type info: is it a function, submodule, ...?
  • Fuzzy search
  • Autocomplete all words in the same CM - https://codemirror.net/demo/anywordhint.html

Please post other ideas and suggestions!

@fonsp fonsp added help welcome If you are experienced in this topic - let us know! good first issue Good for newcomers labels Aug 17, 2020
@cadojo
Copy link

cadojo commented Aug 23, 2020

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.

@fonsp
Copy link
Owner Author

fonsp commented Aug 24, 2020

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

@fonsp
Copy link
Owner Author

fonsp commented Aug 24, 2020

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: fons@plutojl.org

@cadojo
Copy link

cadojo commented Aug 25, 2020

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!

@fonsp
Copy link
Owner Author

fonsp commented Aug 25, 2020

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

@fonsp
Copy link
Owner Author

fonsp commented Aug 30, 2020

#111 (comment)

@pbouffard
Copy link
Contributor

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.

@fonsp
Copy link
Owner Author

fonsp commented Oct 23, 2020

I implemented export info and type info in #606

@pbouffard
Copy link
Contributor

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

@aviatesk
Copy link
Contributor

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.

@fonsp
Copy link
Owner Author

fonsp commented Nov 17, 2020

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

@aviatesk aviatesk mentioned this issue Nov 17, 2020
2 tasks
@FeldrinH
Copy link

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.

@fonsp
Copy link
Owner Author

fonsp commented Apr 22, 2021

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.

@icweaver
Copy link
Contributor

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

@mkschleg
Copy link

mkschleg commented Aug 26, 2021

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.

@hungpham3112
Copy link

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

@fonsp fonsp added the autocomplete <TAB> label Mar 29, 2024
@fonsp fonsp linked a pull request Apr 9, 2024 that will close this issue
5 tasks
@fonsp
Copy link
Owner Author

fonsp commented Apr 15, 2024

Everything here is implemented! Last item is #2389 :)

@fonsp fonsp closed this as completed Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocomplete <TAB> good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants