Search code examples
pythonvisual-studio-codeintellisensecode-snippetsvscode-snippets

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


Solution

  • It appears to me as 2 possibilities:

    1. VS code Python extension problem.
    2. Python version you are using.

    I personally think this problem is more toward VS code extension issue. Try to update Python extension or even downgrade extension version. It might help. If it doesnt, you would probably need to look at common issues of the Python version you are using.

    Cheers