VS Code is adding weird text to my function calls in JavaScript and TypeScript

Viewed 760

VS Code recently started adding weird text to all of my function calls:

enter image description here

path:, algorithm:, data:, etc. aren't in my file. VS Code seems to be adding them. I also can't edit or delete this added text.

What is this text and how can I disable it?

1 Answers

Those are inlay hints. VS Code 1.60 can show parameter names and inferred types for JavaScript and TypeScript using inlay hints. Inlay hints are not part of the file text and will not be saved to disk.

In the example, path:, algorithm:, etc. are parameter name inlay hints that can help you understand at a glance what the arguments to these functions are.

As of VS Code 1.60, inlay hints for JavaScript and TypeScript are disabled by default. If they've become enabled and with you to turn them off again, you can disable the inlay hints feature entirely by setting:

"editor.inlayHints.enabled": false

Keep in mind that this will disable all inlay hints, including those in other languages.

You can also selectively enable/disable specific categories of inlay hints in JavaScript and TypeScript. To disable parameter name hints for example, just set:

"javascript.inlayHints.parameterNames.enabled": "none"
"typescript.inlayHints.parameterNames.enabled": "none"

There are number of other setting that let you control when inlay hints are shown in JavaScript and TypeScript

Related