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"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5 "uri":"test:///foo.pdll",
8 "text":"Constraint ValueCst(value: Value);\nPattern {\nlet arg: ValueCst;\nlet root = op<test.op>(arg);\nreplace root with arg;\n}"
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}
17 // CHECK-NEXT: "jsonrpc": "2.0",
18 // CHECK-NEXT: "result": [
20 // CHECK-NEXT: "range": {
21 // CHECK-NEXT: "end": {
22 // CHECK-NEXT: "character": 19,
23 // CHECK-NEXT: "line": 0
25 // CHECK-NEXT: "start": {
26 // CHECK-NEXT: "character": 11,
27 // CHECK-NEXT: "line": 0
30 // CHECK-NEXT: "uri": "{{.*}}/foo.pdll"
33 // CHECK-NEXT: "range": {
34 // CHECK-NEXT: "end": {
35 // CHECK-NEXT: "character": 17,
36 // CHECK-NEXT: "line": 2
38 // CHECK-NEXT: "start": {
39 // CHECK-NEXT: "character": 9,
40 // CHECK-NEXT: "line": 2
43 // CHECK-NEXT: "uri": "{{.*}}/foo.pdll"
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}
53 // CHECK-NEXT: "jsonrpc": "2.0",
54 // CHECK-NEXT: "result": [
56 // CHECK-NEXT: "range": {
57 // CHECK-NEXT: "end": {
58 // CHECK-NEXT: "character": 7,
59 // CHECK-NEXT: "line": 2
61 // CHECK-NEXT: "start": {
62 // CHECK-NEXT: "character": 4,
63 // CHECK-NEXT: "line": 2
66 // CHECK-NEXT: "uri": "{{.*}}/foo.pdll"
69 // CHECK-NEXT: "range": {
70 // CHECK-NEXT: "end": {
71 // CHECK-NEXT: "character": 26,
72 // CHECK-NEXT: "line": 3
74 // CHECK-NEXT: "start": {
75 // CHECK-NEXT: "character": 23,
76 // CHECK-NEXT: "line": 3
79 // CHECK-NEXT: "uri": "{{.*}}/foo.pdll"
82 // CHECK-NEXT: "range": {
83 // CHECK-NEXT: "end": {
84 // CHECK-NEXT: "character": 21,
85 // CHECK-NEXT: "line": 4
87 // CHECK-NEXT: "start": {
88 // CHECK-NEXT: "character": 18,
89 // CHECK-NEXT: "line": 4
92 // CHECK-NEXT: "uri": "{{.*}}/foo.pdll"
96 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
98 {"jsonrpc":"2.0","method":"exit"}