IntelliSense gets in the way when writing import module as ... statements
See original GitHub issueThis is more of a quality of life enchancement request. I believe the current Intellisense suggestions during python import statements could be improved.
Basically, my problem is during import ... as ...
statements and similar. Taking specifically:
import numpy as np
The suggestions are understandably not helpful since Intellisense can’t predict I will call it np
or whatever I want to call it. However, it gives me suggestions such as NotImplementedError
, presumeably because it contains an N and p. This happens with other packages too (i.e import pandas as pd
).
The problem is that right after I type np
, I want to click Return
, which instead of going to the next line accepts the IntelliSense suggestion. I have to do something like click on the right arrow or first do a space to get out of IntelliSense if I want to go to the next line.
Unfortunately, suggestions to prevent that seem very broad. On StackOverflow the answer was to turn of snippet suggestions, but I think that was just for a specific question and wouldn’t solve everything, since their import tensorflow as tf
was getting IntelliSensed as a try/except block.
So I was wondering if it’s possible for the autocomplete to be modified to not make those suggestions anymore. It seems unlikely that IntelliSense will be able to predict what a module reference will be called by a particular user.
Environment data
- VS Code version: 1.24.0
- Extension version (available under the Extensions sidebar): 2108.5.0
- OS and version: Ubuntu 14.04 and 16.10
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Relevant/affected Python packages and their versions: XXX
Actual behavior
import numpy as np
just after typing it suggests replacing np
with NotImplementedError (this is just a specific example), not letting me Enter
to the next line.
Expected behavior
On the import module as ...
statement, I think IntelliSense shouldn’t try to predict what the module will be renamed as.
Steps to reproduce:
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
XXX
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
XXX
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:8 (3 by maintainers)
@jkyeung hitting escape is how I get around this. It’s become a habit to hit escape before pressing enter if there are completions suggested. I also hit escape if I want to see the code the suggestion is blocking.
Btw I’ve rebound escape to caps lock so this is even easier 😄
Also, you can disable Enter as the key bind to select a suggestion: https://stackoverflow.com/questions/48099898/vs-code-how-to-make-intellisense-activate-with-ctrlspace-but-still-allow-quick
Since VS Code provides a setting for this, we’re closing this issue.