Skip to content
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

Request diagnostic refresh when RuboCop configs change #3041

Merged

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Jan 10, 2025

Motivation

The explanation in microsoft/vscode-languageserver-node#1594 (comment) solved our issue clearing diagnostics. Push and pull diagnostics are two different collections, so you cannot clear diagnostics acquired via pull using a push with an empty array.

The correct solution is to request a diagnostic refresh to the editor, which will then trigger pull diagnostics for all open documents.

Implementation

Changed the implementation to clear our cache and then request a diagnostic refresh, which now correctly recomputes the diagnostics using the new RuboCop configs.

Automated Tests

Added a test to verify that we're request the refresh.

Manual Tests

Screen.Recording.2025-01-10.at.10.21.05.AM.mov

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jan 10, 2025 — with Graphite App
@vinistock vinistock marked this pull request as ready for review January 10, 2025 15:42
@vinistock vinistock requested a review from a team as a code owner January 10, 2025 15:42
@vinistock vinistock force-pushed the 01-10-request_diagnostic_refresh_when_rubocop_configs_change branch from ec62865 to 5dfbc44 Compare January 16, 2025 15:03
@vinistock vinistock force-pushed the 01-10-request_diagnostic_refresh_when_rubocop_configs_change branch from 5dfbc44 to 89d3b59 Compare January 16, 2025 15:26
@vinistock vinistock merged commit dcb4bbe into main Jan 16, 2025
42 checks passed
Copy link
Member Author

Merge activity

  • Jan 16, 10:52 AM EST: A user merged this pull request with Graphite.

@vinistock vinistock deleted the 01-10-request_diagnostic_refresh_when_rubocop_configs_change branch January 16, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants