lsp_keywords.carbon 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // AUTOUPDATE
  5. // TIP: To test this file alone, run:
  6. // TIP: bazel test //testing/file_test:file_test_base_test --test_arg=--file_tests=testing/file_test/testdata/lsp_keywords.carbon
  7. // TIP: To dump output, run:
  8. // TIP: bazel run //testing/file_test:file_test_base_test -- --dump_output --file_tests=testing/file_test/testdata/lsp_keywords.carbon
  9. // --- STDIN
  10. [[@LSP:foo:]]
  11. [[@LSP:foo]]
  12. [[@LSP:bar:"content": 0]]
  13. [[@LSP:baz:
  14. "multi": 0,
  15. "line": 1
  16. ]]
  17. [[@LSP-CALL:bar:"content": 0]]
  18. [[@LSP-CALL:baz:
  19. "multi": 0,
  20. "line": 1]]
  21. [[@LSP-REPLY:7]]
  22. [[@LSP-REPLY:8:"bar": 0]]
  23. [[@LSP-NOTIFY:exit]]
  24. // --- AUTOUPDATE-SPLIT
  25. // CHECK:STDERR: --- STDIN:
  26. // CHECK:STDERR: Content-Length: 34
  27. // CHECK:STDERR:
  28. // CHECK:STDERR: {"jsonrpc":"2.0","method":"foo"}
  29. // CHECK:STDERR:
  30. // CHECK:STDERR: Content-Length: 34
  31. // CHECK:STDERR:
  32. // CHECK:STDERR: {"jsonrpc":"2.0","method":"foo"}
  33. // CHECK:STDERR:
  34. // CHECK:STDERR: Content-Length: 46
  35. // CHECK:STDERR:
  36. // CHECK:STDERR: {"jsonrpc":"2.0","method":"bar","content":0}
  37. // CHECK:STDERR:
  38. // CHECK:STDERR: Content-Length: 53
  39. // CHECK:STDERR:
  40. // CHECK:STDERR: {"jsonrpc":"2.0","method":"baz","multi":0,"line":1}
  41. // CHECK:STDERR:
  42. // CHECK:STDERR: Content-Length: 64
  43. // CHECK:STDERR:
  44. // CHECK:STDERR: {"jsonrpc":"2.0","method":"bar","id":1,"params":{"content":0}}
  45. // CHECK:STDERR:
  46. // CHECK:STDERR: Content-Length: 71
  47. // CHECK:STDERR:
  48. // CHECK:STDERR: {"jsonrpc":"2.0","method":"baz","id":2,"params":{"line":1,"multi":0}}
  49. // CHECK:STDERR:
  50. // CHECK:STDERR: Content-Length: 28
  51. // CHECK:STDERR:
  52. // CHECK:STDERR: {"jsonrpc":"2.0","id":"7"}
  53. // CHECK:STDERR:
  54. // CHECK:STDERR: Content-Length: 47
  55. // CHECK:STDERR:
  56. // CHECK:STDERR: {"jsonrpc":"2.0","id":"8","result":{"bar":0}}
  57. // CHECK:STDERR:
  58. // CHECK:STDERR: Content-Length: 35
  59. // CHECK:STDERR:
  60. // CHECK:STDERR: {"jsonrpc":"2.0","method":"exit"}
  61. // CHECK:STDERR:
  62. // CHECK:STDERR:
  63. // CHECK:STDOUT: 1 args: `default_args`