Skip to content

Return valid responses for pull diagnostics - #4263

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/ruby-lsp-diagnostic-report-4262
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/ruby-lsp-diagnostic-report-4262

Conversation

@efegokdemir

Copy link
Copy Markdown

Motivation

textDocument/diagnostic currently returns null for unsupported documents and when diagnostic computation fails, so clients cannot distinguish an empty report from a failed request.

Implementation

Return an empty full report for unsupported document types and files outside the workspace. Return a JSON-RPC RequestFailed error when diagnostic computation fails, while preserving the existing notifications and logging.

Automated Tests

bundle exec bin/test test/server_test.rb passed (68 runs, 395 assertions). bundle exec srb tc, bundle exec bin/rubocop lib/ruby_lsp/server.rb test/server_test.rb, and git diff --check passed. Commands ran under Ruby 4.0.7; the repository pins Ruby 4.0.5.

Manual Tests

Not run.

@efegokdemir
efegokdemir requested a review from a team as a code owner November 7, 2026 05:18

This branch has not been deployed

No deployments
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.

1 participant