When writing Python code in Cursor, newly created variables do not receive semantic highlighting (e.g., color for variable names). However, when I restart Cursor, the correct colors are applied.
This only happens for new variables written after the editor launches — existing variables are highlighted correctly.
Steps to Reproduce
-
Open a Python file in Cursor.
-
Write a new line, e.g.,
my_var = 123
. -
Notice the variable name
my_var
does not get semantic highlighting. -
Restart Cursor.
-
Now
my_var
is highlighted properly.
Environment
-
Cursor version: [you can get this via
Cmd+Shift+P
→ “About Cursor”] -
OS: macOS / Windows / Linux (choose yours)
-
Python extension installed:
Yes
-
Pylance extension installed:
No (not available in Cursor)
Things I Tried
-
"editor.semanticHighlighting.enabled": true
-
"python.languageServer": "Pylance"
(but Pylance is not listed in extensions) -
Reinstalling the Python extension
-
Reloading the window
Notes
This issue does not happen in VS Code with Pylance installed — new variables get highlighted immediately.
Is this an issue with how Cursor handles the Python extension or semantic tokens?
Would appreciate any insight or fixes