[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / mlir-lsp-server / document-symbols.test
blobbf8ad99bdb1fe5eddd034890d4bbdfc4f155cd08
1 // RUN: mlir-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootUri":"test:///workspace","capabilities":{"textDocument":{"documentSymbol":{"hierarchicalDocumentSymbolSupport":true}}},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.mlir",
6   "languageId":"mlir",
7   "version":1,
8   "text":"module {\nfunc.func private @foo()\n}"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{
12   "textDocument":{"uri":"test:///foo.mlir"}
14 //      CHECK:  "id": 1
15 // CHECK-NEXT:  "jsonrpc": "2.0",
16 // CHECK-NEXT:  "result": [
17 // CHECK-NEXT:    {
18 // CHECK-NEXT:      "children": [
19 // CHECK-NEXT:        {
20 // CHECK-NEXT:          "kind": 12,
21 // CHECK-NEXT:          "name": "foo",
22 // CHECK-NEXT:          "range": {
23 // CHECK-NEXT:            "end": {
24 // CHECK-NEXT:              "character": {{.*}},
25 // CHECK-NEXT:              "line": {{.*}}
26 // CHECK-NEXT:            },
27 // CHECK-NEXT:            "start": {
28 // CHECK-NEXT:              "character": {{.*}},
29 // CHECK-NEXT:              "line": {{.*}}
30 // CHECK-NEXT:            }
31 // CHECK-NEXT:          },
32 // CHECK-NEXT:          "selectionRange": {
33 // CHECK-NEXT:            "end": {
34 // CHECK-NEXT:              "character": 9,
35 // CHECK-NEXT:              "line": {{.*}}
36 // CHECK-NEXT:            },
37 // CHECK-NEXT:            "start": {
38 // CHECK-NEXT:              "character": {{.*}},
39 // CHECK-NEXT:              "line": {{.*}}
40 // CHECK-NEXT:            }
41 // CHECK-NEXT:          }
42 // CHECK-NEXT:        }
43 // CHECK-NEXT:      ],
44 // CHECK-NEXT:      "kind": 3,
45 // CHECK-NEXT:      "name": "<builtin.module>",
46 // CHECK-NEXT:      "range": {
47 // CHECK-NEXT:        "end": {
48 // CHECK-NEXT:          "character": {{.*}},
49 // CHECK-NEXT:          "line": {{.*}}
50 // CHECK-NEXT:        },
51 // CHECK-NEXT:        "start": {
52 // CHECK-NEXT:          "character": {{.*}},
53 // CHECK-NEXT:          "line": {{.*}}
54 // CHECK-NEXT:        }
55 // CHECK-NEXT:      },
56 // CHECK-NEXT:      "selectionRange": {
57 // CHECK-NEXT:        "end": {
58 // CHECK-NEXT:          "character": {{.*}},
59 // CHECK-NEXT:          "line": {{.*}}
60 // CHECK-NEXT:        },
61 // CHECK-NEXT:        "start": {
62 // CHECK-NEXT:          "character": {{.*}},
63 // CHECK-NEXT:          "line": {{.*}}
64 // CHECK-NEXT:        }
65 // CHECK-NEXT:      }
66 // CHECK-NEXT:    }
67 // CHECK-NEXT:  ]
68 // -----
69 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
70 // -----
71 {"jsonrpc":"2.0","method":"exit"}