mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add @LSP-CALL to file_test (#4896)
Adds @LSP-CALL and refactors LSP keyword handling to implicitly handle a
little more of the LSP structure. This is coming out of textDocument
call handling, where this at least reduces some boilerplate of
`"params": {...}`.
This commit is contained in:
+3
-3
@@ -9,15 +9,15 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/language_server/testdata/initialize.carbon
|
||||
|
||||
// --- STDIN
|
||||
[[@LSP:initialize]]
|
||||
[[@LSP-CALL:initialize]]
|
||||
[[@LSP-NOTIFY:exit]]
|
||||
|
||||
// --- AUTOUPDATE-SPLIT
|
||||
|
||||
// CHECK:STDOUT: Content-Length: 148{{\r}}
|
||||
// CHECK:STDOUT: Content-Length: 146{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
// CHECK:STDOUT: "id": "1",
|
||||
// CHECK:STDOUT: "id": 1,
|
||||
// CHECK:STDOUT: "jsonrpc": "2.0",
|
||||
// CHECK:STDOUT: "result": {
|
||||
// CHECK:STDOUT: "capabilities": {
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
|
||||
// --- AUTOUPDATE-SPLIT
|
||||
|
||||
// CHECK:STDERR: warning: -32602: in call to `textDocument/didOpen`, JSON parse failed: expected object [LanguageServerNotificationParseError]
|
||||
// CHECK:STDERR: warning: -32602: in call to `textDocument/didOpen`, JSON parse failed: missing value at (root).textDocument [LanguageServerNotificationParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -18,6 +18,6 @@
|
||||
|
||||
// CHECK:STDERR: warning: unexpected reply to request ID "1": null [LanguageServerUnexpectedReply]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: warning: unexpected reply to request ID "2": 3 [LanguageServerUnexpectedReply]
|
||||
// CHECK:STDERR: warning: unexpected reply to request ID "2": {"result":3} [LanguageServerUnexpectedReply]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -10,18 +10,18 @@
|
||||
|
||||
|
||||
// --- STDIN
|
||||
[[@LSP:unknown-call]]
|
||||
[[@LSP-CALL:unknown-call]]
|
||||
[[@LSP-NOTIFY:exit]]
|
||||
|
||||
// --- AUTOUPDATE-SPLIT
|
||||
|
||||
// CHECK:STDOUT: Content-Length: 122{{\r}}
|
||||
// CHECK:STDOUT: Content-Length: 120{{\r}}
|
||||
// CHECK:STDOUT: {{\r}}
|
||||
// CHECK:STDOUT: {
|
||||
// CHECK:STDOUT: "error": {
|
||||
// CHECK:STDOUT: "code": -32601,
|
||||
// CHECK:STDOUT: "message": "unsupported call `unknown-call`"
|
||||
// CHECK:STDOUT: },
|
||||
// CHECK:STDOUT: "id": "1",
|
||||
// CHECK:STDOUT: "id": 1,
|
||||
// CHECK:STDOUT: "jsonrpc": "2.0"
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user