vscode: Syntax highlighting keeps breaking

Type: Bug

my syntax highlighting for my python code randomly breaks (see the first variable is just “grey” in the first screenshot) image

it is seriously annoying. I have looked on many online sources (https://stackoverflow.com/questions/59775038/visual-studio-code-syntax-highlighting-not-working#:~:text=In my case I needed,as source for the problem.) and this keeps happening.

VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:22:42.175Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info
Item Value
CPUs Intel® Core™ i7-9750H CPU @ 2.60GHz (12 x 2592)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.85GB (17.32GB free)
Process Argv –crash-reporter-id de061326-4473-4e85-9d97-746bfb43069b
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
isort ms- 2023.10.1
pylint ms- 2023.6.0
python ms- 2023.14.0
vscode-pylance ms- 2023.8.30
jupyter ms- 2023.7.1002162226
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
3biah626:30602489
89544117:30613380
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofb:30804716
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
diffeditorv1:30812748

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@JustinSmith66 VS Code offers basic syntax highlighting for Python code and Pylance offers richer ones, I’m trying to figure out if it’s an extension issue or it’s a VS Code core issue. From what I read it’s the same as https://github.com/microsoft/pylance-release/issues/4742, let’s track it there.