Skip to content

Conversation

@mechatroner
Copy link
Contributor

This fixes #265980

The change allows to configure max inlay hints limit.
It is not typical for regular languages to set that many inlay hints but Rainbow CSV extension can generate so many inlay hints in "virtual align" mode.

In order to test the change, the following can be done:

  1. Install "Rainbow CSV" extension: https://marketplace.visualstudio.com/items?itemName=mechatroner.rainbow-csv
  2. Open a test csv file with multiple columns random_wide.csv
  3. Make sure it is highlighted by the Rainbow CSV extension.
  4. Set editor.inlayHints.maxHintsCount to 500 in settings.
  5. Right Click -> "Rainbow CSV" -> "Virtual Align CSV Columns"
  6. Observe that only the top few lines are aligned
  7. Change editor.inlayHints.maxHintsCount to 0 or a very large value
  8. Observe that all lines on the screen are now aligned.

Here are some demo screenshots:

  • Default: 1500 inlay hints max
max_hints_1500 * 500 inlay hints max: max_hints_500 * unlimited inlay hints (set to 0): max_hints_0

Copilot AI review requested due to automatic review settings January 30, 2026 05:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the hardcoded inlay hints limit of 1500 with a configurable option editor.inlayHints.maxHintsCount to address issue #265980. This allows extensions like Rainbow CSV that generate many inlay hints (for virtual column alignment) to configure a higher or unlimited limit.

Changes:

  • Added configurable maxHintsCount option to editor.inlayHints with a default value of 1500 (matching the previous hardcoded limit)
  • Removed the hardcoded _MAX_DECORATORS constant from InlayHintsController
  • Setting maxHintsCount to 0 enables unlimited inlay hints

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/vs/monaco.d.ts Added maxHintsCount property to the IEditorInlayHintsOptions interface for Monaco editor API
src/vs/editor/common/config/editorOptions.ts Defined the maxHintsCount configuration option with default value of 1500, validation, and localized description
src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts Removed hardcoded _MAX_DECORATORS constant and replaced with dynamic retrieval of maxHintsCount from editor options

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The number of Inlay hints is limited

2 participants