-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Improve / disable smart import mapping #568
Comments
Please vote up if you like the feature in general, down if not. |
Do you have it enabled currently? |
Would you like to have it triggered after a configurable timeout of e.g. 50ms by default, so that it would get skipped when typing the i directly after the space? |
I think it will be easier to implement using a callback in Neovim (since we're using a hack via |
Is having the same timeout as with |
Hi there, to answer the first question, the reason I wanted to switch it off is I couldnt get used to it -- I did try (not very hard admittedly) to train myself, but I always found myself typing the "import" keyword, and finding it appear twice. |
regarding the idea of a short delay before the completion starts. As someone who doesn't want the feature, as a default behaviour i think that would solve my problem, but: wouldn't that make the experience worse for the people who do like the feature? In that respect, maybe it's unlike call signatures? Because that's something I sometimes want to see and sometimes don't want, so I don't mind waiting a bit if, as I'm coding, just now is one of the times i do want to see it. but the import keyword autocompletion, i think (maybe?) that's something you either want or don't want, forever. |
In any case, I'm very happy now that I've got the feature switched off. My docs suggestion for improvement would be: rename that section in the docs? and/or the name of the feature? to me, |
Thanks for bringing this up! I'm actually also undecided if it's a great idea. I've gotten used to it, but it still has that kind of strange feeling where when you write |
i'm okay with the feature, i just think it's a bad default and not in keeping with the rest of the stuff this project does for me |
For reference: it's also problematic with |
Well, I would also be fine with another default. That would probably cause less issues. I have realized that |
also, just because something seems callable doesn't mean you want to call it; my least favourite thing about ipython is that it dumps a ( at the end of tab-completed class names |
My current plan would be:
|
I totally agree. That's why I ended up not adding a
I agree. That's probably a more sane default. Feel free to change it. |
I am another person who was really surprised by this behavior. I'm slowly getting used to it and I see benefits, but that was completely unexpected. I have no strong feelings against it, it's just a matter of habit and time to change it. Maybe disabling by default is a good idea indeed. |
I think the proposed improvement should solve this as well, but as someone who likes the feature I wanted to make sure the issue of inserting import twice when copying and pasting (in insert mode) gets flagged separately from typing. If I'm hit with this when I'm typing, its an annoyance, but the fact that I'm annoyed means I'm aware of it and can fix it. This is not the case when I'm copying and pasting.
The behaviour with pasting. I think is in conflict with our mental models of how things work. My mental model for auto-complete, at least, goes something like this: 'When I type the computer looks at what I'm typing and tries to make helpful suggestions about what I want to type next'. Copy and pasting behaviour is directly contrary to this in two ways;
The upshot of this is it seems like unexpected, even illogical behaviour, and it easy to miss, so it can introduce real errors that won't be noticed until another time.
|
Well, normally We should just use a timer for this, and then it requires a recent Vim/Neovim. |
The issue for me is that it types |
See #708 for a fix. |
With something like deoplete/deoplete-jedi it is actually more useful to only add the |
Thanks for your work here. I don't really have time to test this. Other things are more important. If you think this is good enough and if you have tested it well, please self-merge. I would of course prefer if another user here tests it :) |
Since it's now disabled by default (thanks for looking into it!), I'm closing this as solved. |
Given (at least) #524, #559 and #567 we should consider disabling this by default and/or improving it (also with regard to finding it).
You can quite easily find it by searching for "import" in
:h jedi-vim
though.So, calling out to the reporters (@hjwp @tinruufu @chkur) of the issues mentioned above:
What do you dislike about it? (it it too slow? are you keeping to type ahead?)
I could imagine to skip/abort the process in case the user keeps typing and/or only trigger it after e.g. 50ms after the space has been typed.
What do you think?
I've got used to it myself, but can understand that it's surprising - but would still not say to disable it by default (but without knowing how many like this feature).
Let's have a vote in the next comment.
/cc @aliev as the original inventor of this.. :) (in #454).
The text was updated successfully, but these errors were encountered: