Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code color not working when using python types

I am using the new python syntax to describe what types my methods return e.g.,: def method(unpacked_message: dict) -> dict:

This seems to break the vscode color scheme

enter image description here

Expected colors:

enter image description here

Environment and vs code extensions:

  • Python 3.6.9 on ubuntu
  • ms-python.python v2020.11.371526539
  • tht13.python: Python for VS code v0.2.3
  • magicstack.magicpython: MagicPython v1.1.0

The code runs flawlessly. Am I doing something wrong ?

like image 435
Robycool Avatar asked Dec 14 '22 07:12

Robycool


1 Answers

Based on the information you provided, I reproduced the problem you described.

Reason: The Syntax Highlighting style provided by the extension "Python for VSCode" is different from the extension "Python".

Solution: Please disable the extension "Python for VSCode".

before:

enter image description here

after:

enter image description here

like image 128
Jill Cheng Avatar answered Jan 03 '23 10:01

Jill Cheng