[VSCODE] Broken Syntax Highlighting When Add Func Return Type

Tony
2 min readMar 7, 2021

--

Environment

  • VSCODE: version 1.54
  • OS: macOS Big Sur
  • Python: 3.7+

Issue

When you write a function/method in vscode Python editor, and put arrow to mark that the function returns value -> , the arrow is destroying the syntax highlighting and the linter, as follows

Before add return type:

After add return type:

Solution

I spent some time on how to fix this, by checking the following two things:

  • vscode settgins
  • vscode plugins
  • vscode Python language server: ”python.languageServer”: “Microsoft”

Finally it is pointing to this plugin:

Name: Python for VSCode
Id: tht13.python
Description: Python language extension for vscode
Version: 0.2.3
Publisher: Thomas Haakon Townsend
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=tht13.python

By uninstall this plugin and reload, I was able to fix the issue:

I hope this will save you some troubleshooting time, if you are using vscode and ran into the same issue as me.

--

--