Snippets do not work for Python
See original GitHub issueEnvironment data
- VS Code version: 1.52.1
- Extension version (available under the Extensions sidebar): v2021.1.502429796
- OS and version: macOS 11.1
- Python version (& distribution if applicable, e.g. Anaconda): 3.9.1, homebrew
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: N/A
- Relevant/affected Python-related VS Code extensions and their versions: N/A
- Value of the
python.languageServer
setting: Jedi
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Expected behaviour
Code Snippets do not work for Python. This has worked for me before.
Actual behaviour
For example, if I type the def
keyword, code normally snows a popup to insert a snippet which contains a basic definition of a Python function. The snippet for the function no longer works. The def keyword is entered and the snippet is not created.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Here is an example with the for
keyword. Normally, I would see a popup for several types of for statements. This is no longer working.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
No text output is displayed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:19 (8 by maintainers)
Top GitHub Comments
You can install any previous version like this:
Hey folks, sorry for the frustration! The main feedback we got from our snippets is that they’re actually confusing and overwhelming, especially to beginners and students. We often heard they were annoying too, so we ended up removing them. I understand they can still be pretty useful though, I use custom snippets myself. If you want them back you can copy them from here, and then create snippets in VS Code (instructions can be found here: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets). Additionally, as @mikemadden42 pointed out in this comment, you can also get additional snippets through this extension: https://marketplace.visualstudio.com/items?itemName=frhtylcn.pythonsnippets. This way you can still get updates from the Python extension and keep using the snippets 😊
I’m closing this issue as we don’t intend to bring back the snippets for now, at least not until we have a mechanism to make it play nice with Pylance in VS Code.