| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/language_server/testdata/document_symbol/basics.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/language_server/testdata/document_symbol/basics.carbon
- // --- STDIN
- [[@LSP-NOTIFY:textDocument/didOpen:
- "textDocument": {"uri": "file:/empty.carbon", "languageId": "carbon",
- "text": ""}
- ]]
- [[@LSP-CALL:textDocument/documentSymbol:
- "textDocument": {"uri": "file:/empty.carbon"}
- ]]
- [[@LSP-NOTIFY:textDocument/didOpen:
- "textDocument": {"uri": "file:/invalid.carbon", "languageId": "carbon",
- "text": "text"}
- ]]
- [[@LSP-CALL:textDocument/documentSymbol:
- "textDocument": {"uri": "file:/invalid.carbon"}
- ]]
- [[@LSP-NOTIFY:textDocument/didOpen:
- "textDocument": {"uri": "file:/fn.carbon", "languageId": "carbon",
- "text": "fn F() {}"}
- ]]
- [[@LSP-CALL:textDocument/documentSymbol:
- "textDocument": {"uri": "file:/fn.carbon"}
- ]]
- [[@LSP-NOTIFY:exit]]
- // --- AUTOUPDATE-SPLIT
- // CHECK:STDOUT: Content-Length: 49{{\r}}
- // CHECK:STDOUT: {{\r}}
- // CHECK:STDOUT: {
- // CHECK:STDOUT: "id": 1,
- // CHECK:STDOUT: "jsonrpc": "2.0",
- // CHECK:STDOUT: "result": []
- // CHECK:STDOUT: }Content-Length: 49{{\r}}
- // CHECK:STDOUT: {{\r}}
- // CHECK:STDOUT: {
- // CHECK:STDOUT: "id": 2,
- // CHECK:STDOUT: "jsonrpc": "2.0",
- // CHECK:STDOUT: "result": []
- // CHECK:STDOUT: }Content-Length: 459{{\r}}
- // CHECK:STDOUT: {{\r}}
- // CHECK:STDOUT: {
- // CHECK:STDOUT: "id": 3,
- // CHECK:STDOUT: "jsonrpc": "2.0",
- // CHECK:STDOUT: "result": [
- // CHECK:STDOUT: {
- // CHECK:STDOUT: "kind": 12,
- // CHECK:STDOUT: "name": "F",
- // CHECK:STDOUT: "range": {
- // CHECK:STDOUT: "end": {
- // CHECK:STDOUT: "character": 7,
- // CHECK:STDOUT: "line": 0
- // CHECK:STDOUT: },
- // CHECK:STDOUT: "start": {
- // CHECK:STDOUT: "character": 7,
- // CHECK:STDOUT: "line": 0
- // CHECK:STDOUT: }
- // CHECK:STDOUT: },
- // CHECK:STDOUT: "selectionRange": {
- // CHECK:STDOUT: "end": {
- // CHECK:STDOUT: "character": 7,
- // CHECK:STDOUT: "line": 0
- // CHECK:STDOUT: },
- // CHECK:STDOUT: "start": {
- // CHECK:STDOUT: "character": 7,
- // CHECK:STDOUT: "line": 0
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT: ]
- // CHECK:STDOUT: }
|