Several Panics with ts/tsx files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When I open some of my code files (tsx) I see that some of the LSP features (linting, finding references of variables, etc) are broken, and I see the following error messages:

  • Request textDocument/foldingRange failed. Message: InternalError: panic handling request textDocument/foldingRange: runtime error: slice bounds out of range [:17024] with length 17012 Code: -32603
  • Request textDocument/semanticTokens/range failed. Message: InternalError: panic handling request textDocument/semanticTokens/range: semantic tokens: token spans multiple lines: start=(223,45) end=(224,9) for token at offset 9236 Code: -32603

Steps to Reproduce

Just open a project with tsx or ts files.

Expected Behavior

LSP working fine.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 3.4.17
VSCode Version: 1.105.1
Commit: 93e603f703cd553a6bb3644711a3379bbbb31180
Date: 2026-05-13T21:39:55.724Z
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: Darwin arm64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, those panics aren’t coming from Cursor. They’re coming from Microsoft’s TypeScript (Native Preview) extension (typescript-go). You can tell from the stack traces, they’re Go runtime panics in the tsgo LSP server. Cursor is just showing them via standard VS Code error reporting.

About the semanticTokens panic token spans multiple lines. It’s tracked in Panic Alert Notification when Cursor edits some file and opening that file causes panic. · Issue #3621 · microsoft/typescript-go · GitHub, and the fix is already merged upstream in PR #3684 from May 2 ls/semantictokens: skip multi-line tokens instead of panicking by SAY-5 · Pull Request #3684 · microsoft/typescript-go · GitHub. The foldingRange slice bounds out of range panic is the same kind of bug in tsgo.

What to do:

  • Open Extensions with Cmd+Shift+X, find TypeScript (Native Preview), and update to the latest version, or reinstall it.
  • Restart Cursor.

If the foldingRange panic still reproduces after updating, please open a separate issue in Issues · microsoft/typescript-go · GitHub with an LSP trace. They’ll likely fix it faster there.

There’s also a similar thread with the same context here Typescript-go error.

Thanks!