[libc][test] Adjust header paths in tests (#119623)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / inlay-hints.test
blob13c6e202dfd3fd2d975077527cb0d3ed03c04bd1
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 Cst(attr: Attr);\nPattern {\n  op<test.multi>(_: Value, _: Value);\n  op<test.multi>(_: ValueRange) -> (_: Type, _: Type);\n  let op = op<test.multi>;\n  let value = op.0;\n  Cst(_: Attr);\n  erase op;\n}\n"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":2,"method":"textDocument/inlayHint","params":{
12   "textDocument":{"uri":"test:///foo.pdll"},
13   "range": {
14     "start": {"line":3,"character":0},
15     "end": {"line":5,"character":0}
16   }
18 //      CHECK:  "id": 2,
19 // CHECK-NEXT:  "jsonrpc": "2.0",
20 // CHECK-NEXT:  "result": [
21 // CHECK-NEXT:    {
22 // CHECK-NEXT:      "kind": 2,
23 // CHECK-NEXT:      "label": "operand:",
24 // CHECK-NEXT:      "paddingLeft": false,
25 // CHECK-NEXT:      "paddingRight": true,
26 // CHECK-NEXT:      "position": {
27 // CHECK-NEXT:        "character": 17,
28 // CHECK-NEXT:        "line": 3
29 // CHECK-NEXT:      }
30 // CHECK-NEXT:    },
31 // CHECK-NEXT:    {
32 // CHECK-NEXT:      "kind": 2,
33 // CHECK-NEXT:      "label": "operand2:",
34 // CHECK-NEXT:      "paddingLeft": false,
35 // CHECK-NEXT:      "paddingRight": true,
36 // CHECK-NEXT:      "position": {
37 // CHECK-NEXT:        "character": 27,
38 // CHECK-NEXT:        "line": 3
39 // CHECK-NEXT:      }
40 // CHECK-NEXT:    },
41 // CHECK-NEXT:    {
42 // CHECK-NEXT:      "kind": 2,
43 // CHECK-NEXT:      "label": "operands:",
44 // CHECK-NEXT:      "paddingLeft": false,
45 // CHECK-NEXT:      "paddingRight": true,
46 // CHECK-NEXT:      "position": {
47 // CHECK-NEXT:        "character": 17,
48 // CHECK-NEXT:        "line": 4
49 // CHECK-NEXT:      }
50 // CHECK-NEXT:    },
51 // CHECK-NEXT:    {
52 // CHECK-NEXT:      "kind": 2,
53 // CHECK-NEXT:      "label": "result:",
54 // CHECK-NEXT:      "paddingLeft": false,
55 // CHECK-NEXT:      "paddingRight": true,
56 // CHECK-NEXT:      "position": {
57 // CHECK-NEXT:        "character": 36,
58 // CHECK-NEXT:        "line": 4
59 // CHECK-NEXT:      }
60 // CHECK-NEXT:    },
61 // CHECK-NEXT:    {
62 // CHECK-NEXT:      "kind": 2,
63 // CHECK-NEXT:      "label": "result2:",
64 // CHECK-NEXT:      "paddingLeft": false,
65 // CHECK-NEXT:      "paddingRight": true,
66 // CHECK-NEXT:      "position": {
67 // CHECK-NEXT:        "character": 45,
68 // CHECK-NEXT:        "line": 4
69 // CHECK-NEXT:      }
70 // CHECK-NEXT:    }
71 // CHECK-NEXT:  ]
72 // -----
73 {"jsonrpc":"2.0","id":3,"method":"textDocument/inlayHint","params":{
74   "textDocument":{"uri":"test:///foo.pdll"},
75   "range": {
76     "start": {"line":5,"character":0},
77     "end": {"line":8,"character":0}
78   }
80 //      CHECK:  "id": 3,
81 // CHECK-NEXT:  "jsonrpc": "2.0",
82 // CHECK-NEXT:  "result": [
83 // CHECK-NEXT:    {
84 // CHECK-NEXT:      "kind": 1,
85 // CHECK-NEXT:      "label": ": Value",
86 // CHECK-NEXT:      "paddingLeft": false,
87 // CHECK-NEXT:      "paddingRight": false,
88 // CHECK-NEXT:      "position": {
89 // CHECK-NEXT:        "character": 11,
90 // CHECK-NEXT:        "line": 6
91 // CHECK-NEXT:      }
92 // CHECK-NEXT:    },
93 // CHECK-NEXT:    {
94 // CHECK-NEXT:      "kind": 2,
95 // CHECK-NEXT:      "label": "attr:",
96 // CHECK-NEXT:      "paddingLeft": false,
97 // CHECK-NEXT:      "paddingRight": true,
98 // CHECK-NEXT:      "position": {
99 // CHECK-NEXT:        "character": 6,
100 // CHECK-NEXT:        "line": 7
101 // CHECK-NEXT:      }
102 // CHECK-NEXT:    }
103 // CHECK-NEXT:  ]
104 // -----
105 {"jsonrpc":"2.0","id":4,"method":"shutdown"}
106 // -----
107 {"jsonrpc":"2.0","method":"exit"}