Cursor Editor sematic highlighting is slow

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

in large files sematic highlighting is extremely slow. like when I define a variable and it takes a couple seconds to get highlighted. (By the way I am on WSL Ubuntu)

Steps to Reproduce

just try to write code in large files

Operating System

Windows 10/11

Version Information

Version: 3.5.33 (user setup)
VSCode Version: 1.105.1
Commit: aac81804b986d739acab348ed96b8bea6e83cc50
Date: 2026-05-22T06:47:48.039Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, semantic highlighting in big files works through LSP. The language server has to parse the whole file to produce tokens, and VS Code also applies a debounce of about 300 to 2000 ms after each change. WSL adds extra IPC latency between the editor and the language server. This is inherited VS Code behavior, not Cursor-specific.

What you can try:

  1. Disable semantic highlighting полностью, or let the theme decide, in settings.json:

    "editor.semanticHighlighting.enabled": false
    

    or

    "editor.semanticHighlighting.enabled": "configuredByTheme"
    

    Then highlighting will come only from the TextMate grammar, which is faster but less accurate.

  2. Check if an extension is slowing things down. Run cursor --disable-extensions in a terminal and compare.

  3. Let me know what language those files are. For some languages, like TS in huge projects, you can tune the language server settings.

If the issue still happens after this, share the language, the rough file size in lines or KB, and the list of active extensions, and we can dig deeper.

Would not it be better if it cached the whole file instead of parsing it everytime we add new lines? It should only highlight the new lines and not index the whole file

That’s a fair question, but there’s a catch. Semantic highlighting depends on the context of the whole file, not just the new line. When you add a variable, the language server has to recompute references, types, and scope across the file, because the new line can affect tokens elsewhere, like if you renamed a symbol or added an import.

Most language servers already do incremental parsing internally, so they don’t re-parse the file from scratch every time. But semantic analysis still needs to walk the AST. If highlighting only updated the new lines, you’d get inconsistent colors. For example, a new reference to an existing symbol wouldn’t get the right highlight without full context.

TextMate grammar, which you get with "editor.semanticHighlighting.enabled": false, works differently. It uses regex per line with no context. That’s why it’s faster but less accurate. If speed matters more than accuracy in big files, that’s a valid trade-off.

What language are the files where you’re seeing this? For some, like TS, you can tune the language server settings to reduce the load.