0%
May 31, 2024

Get the full type hint from VSCode

vscode

Procedures

Sometimes a type hint from hovering a variable is incomplete and abbreviated by ...:

To get a full hint:

    • For windows. Go to

      <vscode-installation>/resources/app/extensions/node_modules/typescript/lib/

      here <vscode-installation> can be found via where code.

    • For Mac. Go to

      /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/
  • Open tsserver.js

  • Search for defaultMaximumTruncationLength and change this line from 160 to 800

    Remark. Recently ( 2024-09-12) this variable is moved to typescript.ts of the same directory

  • Reload VSCode

  • We get everything now:

Reference