Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser commented Dec 2, 2025

Adds refresh support for

  • inlay hints
  • code lenses

Also

  • Adds a level of nesting to UserPreferences, which is helpful for comparing entire objects and mirroring some of the hierarchy we have in our actual user preferences.
  • Makes hereby run go generate -v so we can see progress.
  • Fixes a few typos with inlay hints preference parsing.

@DanielRosenwasser DanielRosenwasser marked this pull request as ready for review December 2, 2025 22:39
Copilot finished reviewing on behalf of DanielRosenwasser December 2, 2025 22:43
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 adds server-to-client refresh requests for inlay hints and code lenses when user preferences change, enabling dynamic updates without requiring a full editor restart.

Key Changes:

  • Implements RefreshInlayHints and RefreshCodeLens methods on the LSP server that send refresh requests to clients when their respective preference sections change
  • Refactors UserPreferences to nest inlay hints and code lens preferences into dedicated InlayHintsPreferences and CodeLensUserPreferences structs, enabling efficient change detection through struct equality comparisons
  • Fixes typos in preference parsing (supresssuppress)

Reviewed changes

Copilot reviewed 74 out of 74 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/project/client.go Adds RefreshInlayHints and RefreshCodeLens methods to the Client interface
internal/lsp/server.go Implements refresh methods that check client capabilities and send workspace refresh requests
internal/project/session.go Adds logic in Configure to detect preference changes and trigger appropriate refresh requests
internal/ls/lsutil/userpreferences.go Refactors preferences into nested structs, fixes parseSuppress typo, and updates field assignments
internal/ls/inlay_hints.go Updates to use nested InlayHintsPreferences struct, simplifies enabled check using struct comparison
internal/ls/codelens.go Updates to use nested CodeLensUserPreferences struct
internal/testutil/projecttestutil/clientmock_generated.go Auto-generated mock updated with new refresh methods
internal/fourslash/tests/**/*_test.go Updates all test files to use new nested preference structure
internal/fourslash/_scripts/convertFourslash.mts Updates test generation script to output nested preference structure
Herebyfile.mjs Adds -v flag to go generate for verbose output

@DanielRosenwasser
Copy link
Member Author

Looks like, at least for VS Code, a refresh request doesn't actually trigger a new inlay hints request.

microsoft/vscode#280812

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Seems reasonable but FYI @iisaduan on the layout changing (probably formatting should do this)

@DanielRosenwasser DanielRosenwasser added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit 6b60f4a Dec 3, 2025
22 checks passed
@DanielRosenwasser DanielRosenwasser deleted the refreshRequests branch December 3, 2025 03:21
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.

3 participants