Skip to content

Inlay Hints

Show inferred types and parameter names directly in your code.

Type hints display the inferred type for var declarations:

var customer = new Customer(); // var: Customer
var age = 42; // var: int
var items = GetItems(); // var: List<Item>
  1. Open Settings (Ctrl+,)
  2. Search for csharp-dev-tools.inlayHints.enableTypeHints
  3. Enable the setting

Or use Command Palette: “Toggle C# Type Inlay Hints”

  • Understand types at a glance
  • Keep convenience of var
  • Reduce mental overhead
  • Better code comprehension

Parameter hints show parameter names in method calls:

DoSomething(/* value: */ 42, /* name: */ "test", /* enabled: */ true)
  1. Open Settings (Ctrl+,)
  2. Search for csharp-dev-tools.inlayHints.enableParameterHints
  3. Enable the setting
  • Understand method arguments
  • Reduce need to check method signatures
  • Improve code readability
  • Especially helpful for boolean parameters

Customize hint colors in settings.json:

{
"csharpStuff.inlayHints.typeColor": {
"dark": "#606060",
"light": "#808080"
}
}

Hints use VS Code’s inlay hint styling by default. Customize via:

{
"editor.inlayHints.fontSize": 11,
"editor.inlayHints.fontFamily": "monospace"
}

Inlay hints are:

  • Computed on demand
  • Cached for performance
  • Updated as you type
  • Lightweight and fast
  • Use type hints to understand complex LINQ queries
  • Enable parameter hints for methods with many parameters
  • Customize colors to match your theme
  • Toggle off when not needed for cleaner view
  • Ensure C# Language Server is running
  • Check settings are enabled
  • Restart VS Code if needed
  • Verify file is part of project
  • Disable if experiencing slowdowns
  • Check C# Language Server status
  • Reduce hint frequency in settings