SemanticHighlighting doesn't work without reloading window in Python Cursor

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.


:repeat_button: Steps to Reproduce

  1. Open a Python file in Cursor.

  2. Write a new line, e.g., my_var = 123.

  3. Notice the variable name my_var does not get semantic highlighting.

  4. Restart Cursor.

  5. Now my_var is highlighted properly.


:desktop_computer: Environment

  • Cursor version: [you can get this via Cmd+Shift+P → “About Cursor”]

  • OS: macOS / Windows / Linux (choose yours)

  • Python extension installed: :white_check_mark: Yes

  • Pylance extension installed: :cross_mark: No (not available in Cursor)


:white_check_mark: Things I Tried

  • "editor.semanticHighlighting.enabled": true

  • "python.languageServer": "Pylance" (but Pylance is not listed in extensions)

  • Reinstalling the Python extension

  • Reloading the window


:light_bulb: 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 :folded_hands:

1 Like

Seeing the same issue