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

Autocomplete in the editor appends the completed variable onto the preceding expression if there's a token in between #2044

Closed
spyder-bot opened this issue Feb 17, 2015 · 14 comments

Comments

@spyder-bot
Copy link
Collaborator

From jon...@gmail.com on 2014-11-07T19:27:37Z

Spyder Version: 2.4.0dev
Python Version: 2.7.8
Qt Version : 4.8.6, PyQt4 (API v2) 4.10.4 on Windows
pyflakes >=0.5.0: 0.8.1 (OK)
pep8 >=0.6 : 1.5.7 (OK)
IPython >=0.13 : 2.3.0 (OK)
pygments >=1.6 : 1.6 (OK)
pandas >=0.13.1 : 0.15.0 (OK)
sphinx >=0.6.6 : 1.2.3 (OK)
rope >=0.9.2 : 0.9.4 (OK)
matplotlib >=1.0: 1.4.0 (OK)
sympy >=0.7.0 : 0.7.5 (OK)
pylint >=0.25 : None (NOK)

What steps will reproduce the problem?

  1. Go to the editor
    1. Type in a new expression, a token such as '+', and the stem of an existing variable
    2. Hit to autocomplete

What is the expected output? What do you see instead?

For example, if "first_instance" already exists in the editor, typing "XYZ + first", then enter yields the text XYZfirst_instance

Please provide any additional information below

.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=2044

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-09T15:09:17Z

Yes, I've seen this problem too. Steven, could you take a look at it?

Status: Accepted
Owner: steven.s...@gmail.com
Labels: -Priority-Medium Priority-High Cat-Editor MS-v2.3.2

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-09T17:42:39Z

Sure can.

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-09T17:49:08Z

So, I can almost replicate this. When I try it, I get varying overlaps on the word itself:

XYZ + first -> XYZ + fifirst_instance
XYZ + first_ -> XYZ + firfirst_instance

However, this behaviour is completely fixed when I try it using the Jedi-0.8 PR branch. I vote we defer this in favour of that PR.

@spyder-bot
Copy link
Collaborator Author

From contrebasse on 2014-11-10T05:37:57Z

Yes, this was corrected in the Jedi branch, I remember reporting it there.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-10T10:20:12Z

But the Jedi work is going to be merged for 2.4, and we need a fix for 2.3 in the meantime.

@spyder-bot
Copy link
Collaborator Author

From jon...@gmail.com on 2014-11-10T14:20:56Z

I had updated to the 2.4.0dev to fix another issue, and I can't remember/didn't test if it was this way in 2.3.1 or not.

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-10T14:32:25Z

@jonsca, I ran my tests on the current default branch on Bitbucket. @-ccordoba12, I've got a lot of irons in the fire at the moment, I don't think I'll be able to get to this for 2.3.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-11T13:36:52Z

Ok, no problem Steven. I'll dig into what's happening because it's really annoying, and we need a fix for 2.3.2.

Owner: ccordoba12
Labels: -Priority-High Priority-Critical

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-11T14:34:53Z

Hold on Carlos, I've got it. I was overwhelmed this weekend but I'm caught up.


Sent from Mailbox

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-12T09:30:58Z

Ok, thanks for letting me know. I'll wait for your PR then :-)

Owner: steven.s...@gmail.com

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-12T19:29:20Z

Its a pretty simple change, actually:

$ hg diff
diff -r 733f231362e3 spyderlib/widgets/editor.py
--- a/spyderlib/widgets/editor.py Sun Nov 02 15:51:16 2014 -0500
+++ b/spyderlib/widgets/editor.py Wed Nov 12 21:27:29 2014 -0600
@@ -368,7 +368,7 @@
if comp_list:
completion_text = re.findall(r"[\w.]+", text, re.UNICODE)
if completion_text:

  •                completion_text = completion_text[0]
    
  •                completion_text = completion_text[-1]
             else:
                 comp_list = []
             if '.' in completion_text:
    

@spyder-bot
Copy link
Collaborator Author

From steven.s...@gmail.com on 2014-11-12T19:31:22Z

Not worth creating a new branch/PR for.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-15T09:27:14Z

Ok, don't worry about it. I'll commit myself. Thanks a lot for your help Steve, you saved me a lot of time :-)

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-11-15T10:39:08Z

This issue was closed by revision f7b82b909ba0 .

Status: Fixed

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

No branches or pull requests

1 participant