[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / document-symbols.test
bloba62d5c8428685ad8086d4837f79b79697aa3b82a
1 // RUN: mlir-pdll-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.pdll",
6   "languageId":"pdll",
7   "version":1,
8   "text":"Pattern Foo {\nerase op<foo.op>;\n}\nConstraint Cst() -> Op{\nreturn op<toy.test>;\n}\n\nRewrite SomeRewrite() -> Op {\nreturn op: Op;\n}"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{
12   "textDocument":{"uri":"test:///foo.pdll"}
14 //      CHECK:  "id": 1
15 // CHECK-NEXT:  "jsonrpc": "2.0",
16 // CHECK-NEXT:  "result": [
17 // CHECK-NEXT:    {
18 // CHECK-NEXT:      "kind": 5,
19 // CHECK-NEXT:      "name": "Foo",
20 // CHECK-NEXT:      "range": {
21 // CHECK-NEXT:        "end": {
22 // CHECK-NEXT:          "character": 1,
23 // CHECK-NEXT:          "line": 2
24 // CHECK-NEXT:        },
25 // CHECK-NEXT:        "start": {
26 // CHECK-NEXT:          "character": 8,
27 // CHECK-NEXT:          "line": 0
28 // CHECK-NEXT:        }
29 // CHECK-NEXT:      },
30 // CHECK-NEXT:      "selectionRange": {
31 // CHECK-NEXT:        "end": {
32 // CHECK-NEXT:          "character": 11,
33 // CHECK-NEXT:          "line": 0
34 // CHECK-NEXT:        },
35 // CHECK-NEXT:        "start": {
36 // CHECK-NEXT:          "character": 8,
37 // CHECK-NEXT:          "line": 0
38 // CHECK-NEXT:        }
39 // CHECK-NEXT:      }
40 // CHECK-NEXT:    },
41 // CHECK-NEXT:    {
42 // CHECK-NEXT:      "kind": 12,
43 // CHECK-NEXT:      "name": "Cst",
44 // CHECK-NEXT:      "range": {
45 // CHECK-NEXT:        "end": {
46 // CHECK-NEXT:          "character": 14,
47 // CHECK-NEXT:          "line": 3
48 // CHECK-NEXT:        },
49 // CHECK-NEXT:        "start": {
50 // CHECK-NEXT:          "character": 11,
51 // CHECK-NEXT:          "line": 3
52 // CHECK-NEXT:        }
53 // CHECK-NEXT:      },
54 // CHECK-NEXT:      "selectionRange": {
55 // CHECK-NEXT:        "end": {
56 // CHECK-NEXT:          "character": 14,
57 // CHECK-NEXT:          "line": 3
58 // CHECK-NEXT:        },
59 // CHECK-NEXT:        "start": {
60 // CHECK-NEXT:          "character": 11,
61 // CHECK-NEXT:          "line": 3
62 // CHECK-NEXT:        }
63 // CHECK-NEXT:      }
64 // CHECK-NEXT:    },
65 // CHECK-NEXT:    {
66 // CHECK-NEXT:      "kind": 12,
67 // CHECK-NEXT:      "name": "SomeRewrite",
68 // CHECK-NEXT:      "range": {
69 // CHECK-NEXT:        "end": {
70 // CHECK-NEXT:          "character": 19,
71 // CHECK-NEXT:          "line": 7
72 // CHECK-NEXT:        },
73 // CHECK-NEXT:        "start": {
74 // CHECK-NEXT:          "character": 8,
75 // CHECK-NEXT:          "line": 7
76 // CHECK-NEXT:        }
77 // CHECK-NEXT:      },
78 // CHECK-NEXT:      "selectionRange": {
79 // CHECK-NEXT:        "end": {
80 // CHECK-NEXT:          "character": 19,
81 // CHECK-NEXT:          "line": 7
82 // CHECK-NEXT:        },
83 // CHECK-NEXT:        "start": {
84 // CHECK-NEXT:          "character": 8,
85 // CHECK-NEXT:          "line": 7
86 // CHECK-NEXT:        }
87 // CHECK-NEXT:      }
88 // CHECK-NEXT:    }
89 // CHECK-NEXT:  ]
90 // -----
91 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
92 // -----
93 {"jsonrpc":"2.0","method":"exit"}