Skip to content

Commit

Permalink
Merge pull request #627 from detaso/remove-pull-diagnostic
Browse files Browse the repository at this point in the history
LSP: Don't advertise support for Pull Diagnostics
  • Loading branch information
searls authored May 16, 2024
2 parents 3284910 + 2c08391 commit 44b7061
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
8 changes: 0 additions & 8 deletions lib/standard/lsp/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ def for(name)
@writer.write(id: request[:id], result: Proto::Interface::InitializeResult.new(
capabilities: Proto::Interface::ServerCapabilities.new(
document_formatting_provider: true,
diagnostic_provider: LanguageServer::Protocol::Interface::DiagnosticOptions.new(
inter_file_dependencies: false,
workspace_diagnostics: false
),
text_document_sync: Proto::Interface::TextDocumentSyncOptions.new(
change: Proto::Constant::TextDocumentSyncKind::FULL,
open_close: true
Expand All @@ -51,10 +47,6 @@ def for(name)
end
end

handle "textDocument/diagnostic" do |_request|
# no op, diagnostics are handled in textDocument/didChange
end

handle "textDocument/didChange" do |request|
params = request[:params]
result = diagnostic(params[:textDocument][:uri], params[:contentChanges][0][:text])
Expand Down
18 changes: 1 addition & 17 deletions test/standard/runners/lsp_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def test_server_initializes_and_responds_with_proper_capabilities
id: 2,
result: {capabilities: {
textDocumentSync: {openClose: true, change: 1},
documentFormattingProvider: true,
diagnosticProvider: {interFileDependencies: false, workspaceDiagnostics: false}
documentFormattingProvider: true
}},
jsonrpc: "2.0"
}
Expand Down Expand Up @@ -66,21 +65,6 @@ def test_did_open
}, msgs.first)
end

def test_diagnotic_route
msgs, err = run_server_on_requests({
method: "textDocument/diagnostic",
jsonrpc: "2.0",
params: {
textDocument: {
uri: "file:///path/to/file.rb"
}
}
})

assert_equal "", err.string
assert_equal 0, msgs.count
end

def test_format
msgs, err = run_server_on_requests(
{
Expand Down

0 comments on commit 44b7061

Please sign in to comment.