-
Notifications
You must be signed in to change notification settings - Fork 748
Server-to-client refresh requests for user preference updates #2174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
RefreshInlayHintsandRefreshCodeLensmethods on the LSP server that send refresh requests to clients when their respective preference sections change - Refactors
UserPreferencesto nest inlay hints and code lens preferences into dedicatedInlayHintsPreferencesandCodeLensUserPreferencesstructs, enabling efficient change detection through struct equality comparisons - Fixes typos in preference parsing (
supress→suppress)
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 |
|
Looks like, at least for VS Code, a refresh request doesn't actually trigger a new inlay hints request. |
jakebailey
left a comment
There was a problem hiding this 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)
Adds refresh support for
Also
UserPreferences, which is helpful for comparing entire objects and mirroring some of the hierarchy we have in our actual user preferences.herebyrungo generate -vso we can see progress.