close_unknown.carbon 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/language_server/testdata/text_document/close_unknown.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/language_server/testdata/text_document/close_unknown.carbon
  10. // --- STDIN
  11. [[@LSP-CALL:initialize]]
  12. [[@LSP-NOTIFY:textDocument/didClose:
  13. "textDocument": {"uri": "file:/test.carbon"}
  14. ]]
  15. [[@LSP-CALL:shutdown]]
  16. [[@LSP-NOTIFY:exit]]
  17. // --- AUTOUPDATE-SPLIT
  18. // CHECK:STDERR: /test.carbon: warning: tried closing unknown file; ignoring request [LanguageServerCloseUnknownFile]
  19. // CHECK:STDERR:
  20. // CHECK:STDOUT: Content-Length: 146{{\r}}
  21. // CHECK:STDOUT: {{\r}}
  22. // CHECK:STDOUT: {
  23. // CHECK:STDOUT: "id": 1,
  24. // CHECK:STDOUT: "jsonrpc": "2.0",
  25. // CHECK:STDOUT: "result": {
  26. // CHECK:STDOUT: "capabilities": {
  27. // CHECK:STDOUT: "documentSymbolProvider": true,
  28. // CHECK:STDOUT: "textDocumentSync": 2
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT: }Content-Length: 51{{\r}}
  32. // CHECK:STDOUT: {{\r}}
  33. // CHECK:STDOUT: {
  34. // CHECK:STDOUT: "id": 2,
  35. // CHECK:STDOUT: "jsonrpc": "2.0",
  36. // CHECK:STDOUT: "result": null
  37. // CHECK:STDOUT: }