Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code No Longer Shows Default Code Snippet for Python

For some unknown reasons, my VS code no longer shows the default code snippets for Python.

Below is what I see when I type for in the editor (to write the for loop)

enter image description here

I'm expecting to see something like below:

enter image description here

All snippets seem to be missing. Not just the one for for loop.

Things that I have tried:

  1. Re-install VS Code (from scratch by removing the 3 folders as stated in another SO)
  2. Changed the language server from Jedi to Microsoft (as shown below)
  3. Enable snippet suggestions (as shown below)
  4. Enable Pylance extension

enter image description here

Any help is highly appreciated

like image 207
Nik Muhammad Naim Avatar asked Nov 30 '22 20:11

Nik Muhammad Naim


1 Answers

The Python code snippets were removed from the Python extension for Visual Studio Code in the 2021.1.0 (21 January 2021) release. The reasoning was that it was seen causing more harm than helping the user. See for example: Don't suggest Code snippets for import statements

If you want to, you can copy the old snippets (or part of them), and add them as your own snippets.

like image 121
np8 Avatar answered Dec 06 '22 09:12

np8