[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / references.test
bloba0125f0ad8ec3508df2b63ce203aa848949e3daf
1 // RUN: mlir-pdll-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"pdll","capabilities":{},"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":"Constraint ValueCst(value: Value);\nPattern {\nlet arg: ValueCst;\nlet root = op<test.op>(arg);\nreplace root with arg;\n}"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/references","params":{
12   "textDocument":{"uri":"test:///foo.pdll"},
13   "position":{"line":0,"character":15},
14   "context":{"includeDeclaration": false}
16 //      CHECK:  "id": 1
17 // CHECK-NEXT:  "jsonrpc": "2.0",
18 // CHECK-NEXT:  "result": [
19 // CHECK-NEXT:    {
20 // CHECK-NEXT:      "range": {
21 // CHECK-NEXT:        "end": {
22 // CHECK-NEXT:          "character": 19,
23 // CHECK-NEXT:          "line": 0
24 // CHECK-NEXT:        },
25 // CHECK-NEXT:        "start": {
26 // CHECK-NEXT:          "character": 11,
27 // CHECK-NEXT:          "line": 0
28 // CHECK-NEXT:        }
29 // CHECK-NEXT:      },
30 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
31 // CHECK-NEXT:    },
32 // CHECK-NEXT:    {
33 // CHECK-NEXT:      "range": {
34 // CHECK-NEXT:        "end": {
35 // CHECK-NEXT:          "character": 17,
36 // CHECK-NEXT:          "line": 2
37 // CHECK-NEXT:        },
38 // CHECK-NEXT:        "start": {
39 // CHECK-NEXT:          "character": 9,
40 // CHECK-NEXT:          "line": 2
41 // CHECK-NEXT:        }
42 // CHECK-NEXT:      },
43 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
44 // CHECK-NEXT:    }
45 // CHECK-NEXT:  ]
46 // -----
47 {"jsonrpc":"2.0","id":2,"method":"textDocument/references","params":{
48   "textDocument":{"uri":"test:///foo.pdll"},
49   "position":{"line":2,"character":6},
50   "context":{"includeDeclaration": false}
52 //      CHECK:  "id": 2
53 // CHECK-NEXT:  "jsonrpc": "2.0",
54 // CHECK-NEXT:  "result": [
55 // CHECK-NEXT:    {
56 // CHECK-NEXT:      "range": {
57 // CHECK-NEXT:        "end": {
58 // CHECK-NEXT:          "character": 7,
59 // CHECK-NEXT:          "line": 2
60 // CHECK-NEXT:        },
61 // CHECK-NEXT:        "start": {
62 // CHECK-NEXT:          "character": 4,
63 // CHECK-NEXT:          "line": 2
64 // CHECK-NEXT:        }
65 // CHECK-NEXT:      },
66 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
67 // CHECK-NEXT:    },
68 // CHECK-NEXT:    {
69 // CHECK-NEXT:      "range": {
70 // CHECK-NEXT:        "end": {
71 // CHECK-NEXT:          "character": 26,
72 // CHECK-NEXT:          "line": 3
73 // CHECK-NEXT:        },
74 // CHECK-NEXT:        "start": {
75 // CHECK-NEXT:          "character": 23,
76 // CHECK-NEXT:          "line": 3
77 // CHECK-NEXT:        }
78 // CHECK-NEXT:      },
79 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
80 // CHECK-NEXT:    },
81 // CHECK-NEXT:    {
82 // CHECK-NEXT:      "range": {
83 // CHECK-NEXT:        "end": {
84 // CHECK-NEXT:          "character": 21,
85 // CHECK-NEXT:          "line": 4
86 // CHECK-NEXT:        },
87 // CHECK-NEXT:        "start": {
88 // CHECK-NEXT:          "character": 18,
89 // CHECK-NEXT:          "line": 4
90 // CHECK-NEXT:        }
91 // CHECK-NEXT:      },
92 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
93 // CHECK-NEXT:    }
94 // CHECK-NEXT:  ]
95 // -----
96 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
97 // -----
98 {"jsonrpc":"2.0","method":"exit"}