open_duplicate.carbon 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/open_duplicate.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/open_duplicate.carbon
  10. // --- STDIN
  11. [[@LSP-NOTIFY:textDocument/didOpen:
  12. "textDocument": {"uri": "file:/test.carbon", "languageId": "carbon",
  13. "text": "// Empty"}
  14. ]]
  15. [[@LSP-NOTIFY:textDocument/didOpen:
  16. "textDocument": {"uri": "file:/test.carbon", "languageId": "carbon",
  17. "text": "// Empty"}
  18. ]]
  19. [[@LSP-NOTIFY:exit]]
  20. // --- AUTOUPDATE-SPLIT
  21. // CHECK:STDERR: /test.carbon: warning: duplicate open file request; updating content [LanguageServerOpenDuplicateFile]
  22. // CHECK:STDERR:
  23. // CHECK:STDOUT: Content-Length: 144{{\r}}
  24. // CHECK:STDOUT: {{\r}}
  25. // CHECK:STDOUT: {
  26. // CHECK:STDOUT: "jsonrpc": "2.0",
  27. // CHECK:STDOUT: "method": "textDocument/publishDiagnostics",
  28. // CHECK:STDOUT: "params": {
  29. // CHECK:STDOUT: "diagnostics": [],
  30. // CHECK:STDOUT: "uri": "file:///test.carbon"
  31. // CHECK:STDOUT: }
  32. // CHECK:STDOUT: }Content-Length: 144{{\r}}
  33. // CHECK:STDOUT: {{\r}}
  34. // CHECK:STDOUT: {
  35. // CHECK:STDOUT: "jsonrpc": "2.0",
  36. // CHECK:STDOUT: "method": "textDocument/publishDiagnostics",
  37. // CHECK:STDOUT: "params": {
  38. // CHECK:STDOUT: "diagnostics": [],
  39. // CHECK:STDOUT: "uri": "file:///test.carbon"
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: }