How to disable explicit type highlight in Visual Studio Code for C#?

93 Views Asked by At

I installed a new version of the C# extension for Visual Studio Code, and it started to provide highlights inline for explicit typing.

How can I disable this without reverting the extension to an older version?

underlined inline highlight in c# code example

1

There are 1 best solutions below

0
Timothy G. On BEST ANSWER

You want to disable the "Inlay Hints" options. I think you want to disable a few:

  • csharp.inlayHints.enableInlayHintsForTypes
  • csharp.inlayHints.enableInlayHintsForImplicitObjectCreation
  • csharp.inlayHints.enableInlayHintsForLambdaParameterTypes
  • csharp.inlayHints.enableInlayHintsForImplicitVariableTypes

Settings JSON:

{
  "csharp.inlayHints.enableInlayHintsForTypes": false,
  "csharp.inlayHints.enableInlayHintsForImplicitObjectCreation": false,
  "csharp.inlayHints.enableInlayHintsForLambdaParameterTypes": false,
  "csharp.inlayHints.enableInlayHintsForImplicitVariableTypes": false
}

Search "inlay" in the settings and go to the C# tab and you can find all of the various inlay options:

c# inlay hint options