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":"Pattern => replace with ;"
10 // CHECK: "method": "textDocument/publishDiagnostics",
11 // CHECK-NEXT: "params": {
12 // CHECK-NEXT: "diagnostics": [
14 // CHECK-NEXT: "category": "Parse Error",
15 // CHECK-NEXT: "message": "expected expression",
16 // CHECK-NEXT: "range": {
17 // CHECK-NEXT: "end": {
18 // CHECK-NEXT: "character": 23,
19 // CHECK-NEXT: "line": 0
21 // CHECK-NEXT: "start": {
22 // CHECK-NEXT: "character": 19,
23 // CHECK-NEXT: "line": 0
26 // CHECK-NEXT: "severity": 1,
27 // CHECK-NEXT: "source": "pdll"
30 // CHECK-NEXT: "uri": "test:///foo.pdll",
31 // CHECK-NEXT: "version": 1
34 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
35 "uri":"test:///foo.pdll",
37 }, "contentChanges": [{
39 "start":{"line":0,"character":18},
40 "end":{"line":0,"character":18}
42 "text": " op<test.op>"
44 // CHECK: "method": "textDocument/publishDiagnostics",
45 // CHECK-NEXT: "params": {
46 // CHECK-NEXT: "diagnostics": [
48 // CHECK-NEXT: "category": "Parse Error",
49 // CHECK-NEXT: "message": "expected expression",
50 // CHECK-NEXT: "range": {
51 // CHECK-NEXT: "end": {
52 // CHECK-NEXT: "character": 37,
53 // CHECK-NEXT: "line": 0
55 // CHECK-NEXT: "start": {
56 // CHECK-NEXT: "character": 36,
57 // CHECK-NEXT: "line": 0
60 // CHECK-NEXT: "severity": 1,
61 // CHECK-NEXT: "source": "pdll"
64 // CHECK-NEXT: "uri": "test:///foo.pdll",
65 // CHECK-NEXT: "version": 2
68 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
69 "uri":"test:///foo.pdll",
71 }, "contentChanges": [
74 "start":{"line":0,"character":30},
75 "end":{"line":0,"character":30}
77 "text": "(values: ValueRange)"
81 "start":{"line":0,"character":56},
82 "end":{"line":0,"character":57}
87 // CHECK: "method": "textDocument/publishDiagnostics",
88 // CHECK-NEXT: "params": {
89 // CHECK-NEXT: "diagnostics": [],
90 // CHECK-NEXT: "uri": "test:///foo.pdll",
91 // CHECK-NEXT: "version": 3
94 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
96 {"jsonrpc":"2.0","method":"exit"}