[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / signature-help.test
blobd7e88d40d370de36265d9a8bf72c7386106bbd3d
1 // RUN: mlir-pdll-lsp-server -pdll-extra-dir %S -pdll-extra-dir %S/../../include -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":"#include \"include/included.td\"\nConstraint ValueCst(value: Value, value2: Value);\nPattern {\nlet root = op<test.multi>(val: Value, val) -> (ty: Type, ty);\nValueCst(root.result, root.result2);\nerase root;\n}"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
12   "textDocument":{"uri":"test:///foo.pdll"},
13   "position":{"line":3,"character":26}
15 //      CHECK:  "id": 1
16 // CHECK-NEXT:  "jsonrpc": "2.0",
17 // CHECK-NEXT:  "result": {
18 // CHECK-NEXT:    "activeParameter": 0,
19 // CHECK-NEXT:    "activeSignature": 0,
20 // CHECK-NEXT:    "signatures": [
21 // CHECK-NEXT:      {
22 // CHECK-NEXT:        "documentation": "`op<test.multi>` ODS operand specification",
23 // CHECK-NEXT:        "label": "(operand: Value, operand2: Value)",
24 // CHECK-NEXT:        "parameters": [
25 // CHECK-NEXT:          {
26 // CHECK-NEXT:            "documentation": "64-bit signless integer",
27 // CHECK-NEXT:            "label": [
28 // CHECK-NEXT:              1,
29 // CHECK-NEXT:              15
30 // CHECK-NEXT:            ]
31 // CHECK-NEXT:          },
32 // CHECK-NEXT:          {
33 // CHECK-NEXT:            "documentation": "64-bit signless integer",
34 // CHECK-NEXT:            "label": [
35 // CHECK-NEXT:              17,
36 // CHECK-NEXT:              32
37 // CHECK-NEXT:            ]
38 // CHECK-NEXT:          }
39 // CHECK-NEXT:        ]
40 // CHECK-NEXT:      },
41 // CHECK-NEXT:      {
42 // CHECK-NEXT:        "documentation": "Generic operation operand specification",
43 // CHECK-NEXT:        "label": "(<operands>: ValueRange)",
44 // CHECK-NEXT:        "parameters": [
45 // CHECK-NEXT:          {
46 // CHECK-NEXT:            "documentation": "All of the operands of the operation.",
47 // CHECK-NEXT:            "label": [
48 // CHECK-NEXT:              1,
49 // CHECK-NEXT:              23
50 // CHECK-NEXT:            ]
51 // CHECK-NEXT:          }
52 // CHECK-NEXT:        ]
53 // CHECK-NEXT:      }
54 // CHECK-NEXT:    ]
55 // CHECK-NEXT:  }
56 // -----
57 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
58   "textDocument":{"uri":"test:///foo.pdll"},
59   "position":{"line":3,"character":38}
61 //      CHECK:  "id": 1
62 // CHECK-NEXT:  "jsonrpc": "2.0",
63 // CHECK-NEXT:  "result": {
64 // CHECK-NEXT:    "activeParameter": 1,
65 // CHECK-NEXT:    "activeSignature": 0,
66 // CHECK-NEXT:    "signatures": [
67 // CHECK-NEXT:      {
68 // CHECK-NEXT:        "documentation": "`op<test.multi>` ODS operand specification",
69 // CHECK-NEXT:        "label": "(operand: Value, operand2: Value)",
70 // CHECK-NEXT:        "parameters": [
71 // CHECK-NEXT:          {
72 // CHECK-NEXT:            "documentation": "64-bit signless integer",
73 // CHECK-NEXT:            "label": [
74 // CHECK-NEXT:              1,
75 // CHECK-NEXT:              15
76 // CHECK-NEXT:            ]
77 // CHECK-NEXT:          },
78 // CHECK-NEXT:          {
79 // CHECK-NEXT:            "documentation": "64-bit signless integer",
80 // CHECK-NEXT:            "label": [
81 // CHECK-NEXT:              17,
82 // CHECK-NEXT:              32
83 // CHECK-NEXT:            ]
84 // CHECK-NEXT:          }
85 // CHECK-NEXT:        ]
86 // CHECK-NEXT:      }
87 // CHECK-NEXT:    ]
88 // CHECK-NEXT:  }
89 // -----
90 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
91   "textDocument":{"uri":"test:///foo.pdll"},
92   "position":{"line":3,"character":47}
94 //      CHECK:  "id": 1
95 // CHECK-NEXT:  "jsonrpc": "2.0",
96 // CHECK-NEXT:  "result": {
97 // CHECK-NEXT:    "activeParameter": 0,
98 // CHECK-NEXT:    "activeSignature": 0,
99 // CHECK-NEXT:    "signatures": [
100 // CHECK-NEXT:      {
101 // CHECK-NEXT:        "documentation": "`op<test.multi>` ODS result specification",
102 // CHECK-NEXT:        "label": "(result: Type, result2: Type)",
103 // CHECK-NEXT:        "parameters": [
104 // CHECK-NEXT:          {
105 // CHECK-NEXT:            "documentation": "64-bit signless integer",
106 // CHECK-NEXT:            "label": [
107 // CHECK-NEXT:              1,
108 // CHECK-NEXT:              13
109 // CHECK-NEXT:            ]
110 // CHECK-NEXT:          },
111 // CHECK-NEXT:          {
112 // CHECK-NEXT:            "documentation": "64-bit signless integer",
113 // CHECK-NEXT:            "label": [
114 // CHECK-NEXT:              15,
115 // CHECK-NEXT:              28
116 // CHECK-NEXT:            ]
117 // CHECK-NEXT:          }
118 // CHECK-NEXT:        ]
119 // CHECK-NEXT:      },
120 // CHECK-NEXT:      {
121 // CHECK-NEXT:        "documentation": "Generic operation result specification",
122 // CHECK-NEXT:        "label": "(<results>: TypeRange)",
123 // CHECK-NEXT:        "parameters": [
124 // CHECK-NEXT:          {
125 // CHECK-NEXT:            "documentation": "All of the results of the operation.",
126 // CHECK-NEXT:            "label": [
127 // CHECK-NEXT:              1,
128 // CHECK-NEXT:              21
129 // CHECK-NEXT:            ]
130 // CHECK-NEXT:          }
131 // CHECK-NEXT:        ]
132 // CHECK-NEXT:      }
133 // CHECK-NEXT:    ]
134 // CHECK-NEXT:  }
135 // -----
136 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
137   "textDocument":{"uri":"test:///foo.pdll"},
138   "position":{"line":3,"character":57}
140 //      CHECK:  "id": 1
141 // CHECK-NEXT:  "jsonrpc": "2.0",
142 // CHECK-NEXT:  "result": {
143 // CHECK-NEXT:    "activeParameter": 1,
144 // CHECK-NEXT:    "activeSignature": 0,
145 // CHECK-NEXT:    "signatures": [
146 // CHECK-NEXT:      {
147 // CHECK-NEXT:        "documentation": "`op<test.multi>` ODS result specification",
148 // CHECK-NEXT:        "label": "(result: Type, result2: Type)",
149 // CHECK-NEXT:        "parameters": [
150 // CHECK-NEXT:          {
151 // CHECK-NEXT:            "documentation": "64-bit signless integer",
152 // CHECK-NEXT:            "label": [
153 // CHECK-NEXT:              1,
154 // CHECK-NEXT:              13
155 // CHECK-NEXT:            ]
156 // CHECK-NEXT:          },
157 // CHECK-NEXT:          {
158 // CHECK-NEXT:            "documentation": "64-bit signless integer",
159 // CHECK-NEXT:            "label": [
160 // CHECK-NEXT:              15,
161 // CHECK-NEXT:              28
162 // CHECK-NEXT:            ]
163 // CHECK-NEXT:          }
164 // CHECK-NEXT:        ]
165 // CHECK-NEXT:      }
166 // CHECK-NEXT:    ]
167 // CHECK-NEXT:  }
168 // -----
169 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
170   "textDocument":{"uri":"test:///foo.pdll"},
171   "position":{"line":4,"character":9}
173 //      CHECK:  "id": 1
174 // CHECK-NEXT:  "jsonrpc": "2.0",
175 // CHECK-NEXT:  "result": {
176 // CHECK-NEXT:    "activeParameter": 0,
177 // CHECK-NEXT:    "activeSignature": 0,
178 // CHECK-NEXT:    "signatures": [
179 // CHECK-NEXT:      {
180 // CHECK-NEXT:        "label": "ValueCst(value: Value, value2: Value) -> Tuple<>",
181 // CHECK-NEXT:        "parameters": [
182 // CHECK-NEXT:          {
183 // CHECK-NEXT:            "label": [
184 // CHECK-NEXT:              9,
185 // CHECK-NEXT:              21
186 // CHECK-NEXT:            ]
187 // CHECK-NEXT:          },
188 // CHECK-NEXT:          {
189 // CHECK-NEXT:            "label": [
190 // CHECK-NEXT:              23,
191 // CHECK-NEXT:              36
192 // CHECK-NEXT:            ]
193 // CHECK-NEXT:          }
194 // CHECK-NEXT:        ]
195 // CHECK-NEXT:      }
196 // CHECK-NEXT:    ]
197 // CHECK-NEXT:  }
198 // -----
199 {"jsonrpc":"2.0","id":1,"method":"textDocument/signatureHelp","params":{
200   "textDocument":{"uri":"test:///foo.pdll"},
201   "position":{"line":4,"character":21}
203 //      CHECK:  "id": 1
204 // CHECK-NEXT:  "jsonrpc": "2.0",
205 // CHECK-NEXT:  "result": {
206 // CHECK-NEXT:    "activeParameter": 1,
207 // CHECK-NEXT:    "activeSignature": 0,
208 // CHECK-NEXT:    "signatures": [
209 // CHECK-NEXT:      {
210 // CHECK-NEXT:        "label": "ValueCst(value: Value, value2: Value) -> Tuple<>",
211 // CHECK-NEXT:        "parameters": [
212 // CHECK-NEXT:          {
213 // CHECK-NEXT:            "label": [
214 // CHECK-NEXT:              9,
215 // CHECK-NEXT:              21
216 // CHECK-NEXT:            ]
217 // CHECK-NEXT:          },
218 // CHECK-NEXT:          {
219 // CHECK-NEXT:            "label": [
220 // CHECK-NEXT:              23,
221 // CHECK-NEXT:              36
222 // CHECK-NEXT:            ]
223 // CHECK-NEXT:          }
224 // CHECK-NEXT:        ]
225 // CHECK-NEXT:      }
226 // CHECK-NEXT:    ]
227 // CHECK-NEXT:  }
228 // -----
229 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
230 // -----
231 {"jsonrpc":"2.0","method":"exit"}