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

Poor code completion behavior #741

Closed
fonnesbeck opened this issue Dec 14, 2020 · 2 comments
Closed

Poor code completion behavior #741

fonnesbeck opened this issue Dec 14, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@fonnesbeck
Copy link

Environment data

  • VS Code version: 1.52.0
  • Extension version (available under the Extensions sidebar): 2020.11.2
  • OS and version: macOS Big Sur
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Value of the python.languageServer setting: pylance

Expected behaviour

If I type: import pandas as pd into VSCode and hit enter, I should see this line in the editor, plus a new line/carriage return.

Actual behaviour

I end up with import pandas as import pdb; pdb.set_trace() because of overzealous code completion. The engine ought to know that the as expression is setting up an alias and not attempt to drop in a completely unrelated snippet.

Steps to reproduce:

  1. Open a blank Python file
  2. Type import pandas as pd and hit the return key
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Dec 15, 2020
@jakebailey
Copy link
Member

This is due to the Python extension's snippets: microsoft/vscode-python#14781

See also #629.

You can disable snippets by setting:

"[python]": {
    "editor.snippetSuggestions": "none"
}

@jakebailey
Copy link
Member

I'm going to close this as a dupe of #604, though, as it's rougly the same issue but wasn't entirely fixed.

@jakebailey jakebailey added the duplicate This issue or pull request already exists label Dec 15, 2020
@github-actions github-actions bot removed the triage label Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants