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

Overly eager autocomplete #3008

Open
mihrits opened this issue Aug 22, 2024 · 7 comments
Open

Overly eager autocomplete #3008

mihrits opened this issue Aug 22, 2024 · 7 comments
Labels

Comments

@mihrits
Copy link

mihrits commented Aug 22, 2024

I have noticed that Pluto has started to eagerly autocomplete things that I don't want to autocomplete. It seems that autocompletion is carried out by many different triggers; for example, I have found so far ,, ., (, [, in addition to <Tab>. A recording of this behavior:

Pluto_autocomplete.mov

This is really counterproductive; for example, when trying to write x, y, z, I have to press <Esc> every time before entering a comma.

There is a short discussion on Slack in the #pluto channel with a suggestion that this might stem from PR#2942 (I am using MacOS). This behavior is also mentioned in Discussion#3001. I was encouraged to open an issue, as this was bothering more people.

I would expect the autocomplete to be carried out with explicit <Tab> or when starting to choose autocomplete options with arrow keys and then <Tab> or <Return>.

Information about my setup:

julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 6 virtual cores)
Environment:
  JULIA_EDITOR = nvim

This behavior shows up in [c3e4b0f8] Pluto v0.19.46.

@disberd
Copy link
Contributor

disberd commented Aug 22, 2024

I thought it was more documented but indeed it's not clearly stated in the original PR.

The way to disable this (in a way that persists between Pluto sessions for the same browser and port) is to open your browser developer console and execute the following:
PLUTO_TOGGLE_CM_AUTOCOMPLETE_ON_TYPE() which is a function that toggles whether this behavior is enabled or not.

You can also check your current pluto browser cached options with window.localStorage:
image

That being said, as a comment to the issue at hand I also find the automatic autocomplete especially on , and . to be more frustrating than useful in my case, so I'd rather this be toned down as well (I also discussed this with @Pangoraw at the juliacon hackaton)

@fonsp
Copy link
Owner

fonsp commented Aug 24, 2024

Thanks for the feedback @mihrits !

Could you give some examples of cases where this happened during your normal work? The example x, y, z that you gave is happening because x,y,z are not defined in the empty notebook that you made to demonstrate the issue. But I'm curious when exactly the eager autocompletion is an issue during real use.

@fonsp fonsp added the autocomplete <TAB> label Aug 24, 2024
@fonsp
Copy link
Owner

fonsp commented Aug 24, 2024

For other people who see this issue and want to leave feedback, please record a video and open a new issue! (Instead of replying here) It is helpful for us if different specific autocomplete problems are addressed in different issues.

@mihrits
Copy link
Author

mihrits commented Aug 25, 2024

During normal work, this happens when I define new variables or functions. For example, when I try to define x, y, z = crds. Or another example, when I define a function with a short name. For example, when want to define function f(x) I have to use <esc> before writing the parenthesis. This also happens when listing columns from a DataFrame, because (I think) the column names are not defined and when I have a list of short column names, I have to cancel the autocomplete after every name before adding a comma. For example, select(df, :Ex, :Ey, :Ez).

@aplavin
Copy link
Contributor

aplavin commented Aug 25, 2024

Totally agree, it definitely feels overeager very often. Auto-accepting completions makes blind/muscle memory typing impossible. Thanks for the solution to turn it off!
IMO, a better way would be to show completions automatically, but only accept them on tab.

@kellertuer
Copy link

kellertuer commented Sep 7, 2024

To me it also happens when I load new packages (since those seem to not be defined variables?), or when I want to broadcast Float64.( when typing the . some autocomplete starts and goes bogus.

Also as said before, defining any new variable has become a quite annoying.

I like the more inactive variants, that TAB autocompletes (like VS code does for example) but space does not.

edit: It would be nice to have this disabling somewhere in a menu and maybe even something saved in some preferences. To me the current default is very very very different to what I am used in VS Code and I get annoyed by this roughly every 30 seconds.

@kellertuer
Copy link

I noticed the most annoying auto-complete-trigger by now is . if you have the smallest typo somewhere, usually the . would not open the autocomplete for fields, one would notice the typo, goes back and it is fine.

With the smallest typo, the autocomplete tries to guess anything maybe close to the typo, but usually far far off. That gets me very often and is (for me) super annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants