question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On the fly code completion interferes with normal typing

See original GitHub issue

Description

What steps will reproduce the problem?

This may be intended behavior, however, it didn’t happen with 3.X.

With code completion and on the fly code completion turned on (note these are on different panes in preferences, which makes discovery hard), try to type the following function definition in a new editor window.

def f(x):
    return x

The code completion pops up a window with xrange as the completion of the return x. If you are typing quickly (as I do) it will auto-complete x as xrange, yielding

def f(x):
    return xrange

I think 3.x had a way to control whether ENTER auto completes or not, I don’t think I see that in 4 (this issue reporter window is modal, so I can’t check while I am typing this)

Anyway, this may be the intended/desired behavior, but I find it hard to imagine most will find it useful. One may counter that x is a bad variable name, but I only really do math in Python, so x is very common usage.

Versions

  • Spyder version: 4.0.0b4
  • Python version: 3.7.3
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 7

Dependencies

pygments >=2.0    :  2.4.2 (OK)
qdarkstyle >=2.6.4:  2.7 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
pyls >=0.27.0     :  0.28.2 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
pandas >=0.13.1   :  0.25.1 (OK)
numpy >=1.7       :  1.16.4 (OK)
sympy >=0.7.3     :  1.4 (OK)
cython >=0.21     :  0.29.13 (OK)
qtconsole >=4.5.2 :  4.5.4 (OK)
IPython >=4.0     :  7.8.0 (OK)
matplotlib >=2.0.0:  3.1.1 (OK)
pylint >=0.25     :  2.3.1 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:28 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
goanpecacommented, Sep 20, 2019

@rlabbe yes! as @CAM-Gerlach suggested I was indeed asking you to test it to see if it improved your use case. could you please test using the indications by @CAM-Gerlach ?

Cheers

1reaction
CAM-Gerlachcommented, Sep 19, 2019

Completion | Linting | Introspection | Code style | ...

Not to bikeshed over a relatively minor detail, but you might consider swapping the positions of Linting and Introspection so that completion, code style and docstring style are still contiguous (as they are currently) given that all three fall under real-time code analysis.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Syntax-Aware On-the-Fly Code Completion - arXiv
Given a sequence of code tokens, our approach performs the following steps: (1) extract the token type information of each token, (2) perform ......
Read more >
Code completion | IntelliJ IDEA Documentation - JetBrains
If automatic completion is disabled, press Ctrl+Shift+Space or choose Code | Code Completion | Type-Matching from the main menu. If necessary, press Ctrl+Shift ......
Read more >
Duplicate hints while typing expression in Visual Studio Code
In my case (for python ) i had the pylance extension added. When i disabled this, the problem went away, but features were...
Read more >
When Code Completion Fails: a Case Study on Real-World ...
Completion Type : each completion in our benchmark data concerns an identifier. We distinguish between them based on the identifier's type (project-internal, C# ......
Read more >
Code Completion - RAD Studio - Embarcadero DocWiki
When Auto Invoke is enabled for Code Completion, typing a period (.) ... by dragging the lower right corner as you would normally...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found