Skip to content

Instantly share code, notes, and snippets.

@avisek
Last active October 11, 2025 15:44
Show Gist options
  • Select an option

  • Save avisek/d2127725480a390939f8814f11f9c019 to your computer and use it in GitHub Desktop.

Select an option

Save avisek/d2127725480a390939f8814f11f9c019 to your computer and use it in GitHub Desktop.

Fix TypeScript Type Truncation

Fixes TypeScript editors truncating types with "... N more" by increasing defaultMaximumTruncationLength from 160 to 16000 and defaultHoverMaximumTruncationLength from 500 to 50000.

macOS

Cursor:

sed -i '' -e 's/var defaultMaximumTruncationLength = 160;/var defaultMaximumTruncationLength = 16000;/' -e 's/var defaultHoverMaximumTruncationLength = 500;/var defaultHoverMaximumTruncationLength = 50000;/' '/Applications/Cursor.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js'

VS Code:

sed -i '' -e 's/var defaultMaximumTruncationLength = 160;/var defaultMaximumTruncationLength = 16000;/' -e 's/var defaultHoverMaximumTruncationLength = 500;/var defaultHoverMaximumTruncationLength = 50000;/' '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typescript.js'

Note: Restart editor after applying. Changes reset on app updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment