lsp_autofill.carbon 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_autofill.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_autofill.carbon
  9. // --- foo.carbon
  10. class Foo {
  11. fn foo();
  12. fn bar() {}
  13. }
  14. // --- STDIN
  15. [[@LSP-NOTIFY:textDocument/didOpen:
  16. "textDocument": {
  17. "uri": "file:/foo.carbon",
  18. "languageId": "carbon",
  19. "text": "FROM_FILE_SPLIT"
  20. }
  21. ]]
  22. // --- AUTOUPDATE-SPLIT
  23. // CHECK:STDERR: --- STDIN:
  24. // CHECK:STDERR: Content-Length: 182
  25. // CHECK:STDERR:
  26. // CHECK:STDERR: {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"carbon","text":"class Foo {\n fn foo();\n fn bar() {}\n}\n\n","uri":"file:/foo.carbon"}}}
  27. // CHECK:STDERR:
  28. // CHECK:STDERR:
  29. // CHECK:STDOUT: 2 args: `default_args`, `foo.carbon`
  30. // CHECK:STDOUT: foo.carbon:1: class Foo {
  31. // CHECK:STDOUT: foo.carbon:2: fn foo();
  32. // CHECK:STDOUT: foo.carbon:3: fn bar() {}
  33. // CHECK:STDOUT: foo.carbon:4: }