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

Autocomplete constants is appending logical operators at the end #1115

Closed
gshellikeri opened this Issue Apr 6, 2017 · 10 comments

Comments

Projects
None yet
6 participants
@gshellikeri

gshellikeri commented Apr 6, 2017

Hi,

Thanks for all your work on elpy. It is a pleasure to use!
I am seeing that autocomplete wants to change my constants by appending logical operators at the end. I have attached a screenshot of this happening. This is very bothersome to say the least!

screen shot 2017-04-06 at 2 47 06 pm

@jorgenschaefer jorgenschaefer added this to the v1.15 milestone Apr 14, 2017

@jorgenschaefer jorgenschaefer added the bug label Apr 14, 2017

@jorgenschaefer

This comment has been minimized.

Owner

jorgenschaefer commented Apr 14, 2017

Hello, and thanks for the report. Yes, this looks really weird. I have seen this before, but I have not been able to reproduce it. It does not always happen to me. Have you tried M-x elpy-rpc-restart to see if that fixes it?

@lgp171188

This comment has been minimized.

Contributor

lgp171188 commented Apr 18, 2017

I ran M-x elpy-rpc-restart but this happens even after that.

@jorgenschaefer

This comment has been minimized.

Owner

jorgenschaefer commented Apr 21, 2017

Yeah, this seems to be a bug in Jedi (see the #1123 comments) – reported upstream …

@davidhalter

This comment has been minimized.

davidhalter commented Apr 21, 2017

1and"" is valid code :) There's way weirder stuff without spaces that works in Python: br''or.0jif.1else-....

I gave a talk about it. It's not a perfect one, but some some parts are interesting and fun :) https://www.youtube.com/watch?v=6NVUbO7pFtA

@jorgenschaefer

This comment has been minimized.

Owner

jorgenschaefer commented Apr 21, 2017

It might be valid code, but is it useful to offer as a suggestion?

Oh well, I guess Elpy can just avoid asking Jedi for completions when the symbol before point is a number …

@davidhalter

This comment has been minimized.

davidhalter commented Apr 21, 2017

I can understand your concerns, but I don't think it's Jedi's job to choose when to show completions. I think it's Jedi's job to be correct.

@abred

This comment has been minimized.

abred commented Apr 21, 2017

the behaviour in my case (#1123) is slightly different, it doesn't append the keyword to the number, it changes the number to the keyword (might be because of autocomplete vs company?)

emacscompletion

@jorgenschaefer

This comment has been minimized.

Owner

jorgenschaefer commented Apr 21, 2017

Hm. Elpy does not use autocomplete, so that shouldn't be an issue. Possibly some confusion in Elpy, because the suggested completions do not start with the symbol before point.

@jorgenschaefer jorgenschaefer modified the milestones: v1.15, v1.16 May 13, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.16, v1.17 Jul 28, 2017

@jorgenschaefer jorgenschaefer modified the milestones: v1.17, v1.18 Nov 3, 2017

@jsoishi

This comment has been minimized.

jsoishi commented Jan 18, 2018

I am also having this problem. I've noticed that it only happens on numbers with three or more digits. I also see the replacement rather than append
elpy_bug

@jorgenschaefer

This comment has been minimized.

Owner

jorgenschaefer commented Jan 19, 2018

IIRC, the Jedi people said at some point that this is valid Python (there is no required space between the number and the operator, even if the operator is and), so this is a correct completion. I guess Elpy could avoid asking for completions if the symbol before point is entirely made up of digits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment