Fix GCC build problem with 288f05f related to SmallVector. (#116958)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / textdocument-didchange.test
blob7ef362a28dba586eda6cd2816bfb566ff28290a8
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":"Pattern => replace with ;"
9 }}}
10 // CHECK: "method": "textDocument/publishDiagnostics",
11 // CHECK-NEXT: "params": {
12 // CHECK-NEXT:     "diagnostics": [
13 // CHECK-NEXT:       {
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
20 // CHECK-NEXT:           },
21 // CHECK-NEXT:           "start": {
22 // CHECK-NEXT:             "character": 19,
23 // CHECK-NEXT:             "line": 0
24 // CHECK-NEXT:           }
25 // CHECK-NEXT:         },
26 // CHECK-NEXT:         "severity": 1,
27 // CHECK-NEXT:         "source": "pdll"
28 // CHECK-NEXT:       }
29 // CHECK-NEXT:     ],
30 // CHECK-NEXT:     "uri": "test:///foo.pdll",
31 // CHECK-NEXT:     "version": 1
32 // CHECK-NEXT:   }
33 // -----
34 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
35   "uri":"test:///foo.pdll",
36   "version":2
37 }, "contentChanges": [{
38   "range":{
39     "start":{"line":0,"character":18},
40     "end":{"line":0,"character":18}
41   },
42   "text": " op<test.op>"
43 }]}}
44 // CHECK: "method": "textDocument/publishDiagnostics",
45 // CHECK-NEXT: "params": {
46 // CHECK-NEXT:     "diagnostics": [
47 // CHECK-NEXT:       {
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
54 // CHECK-NEXT:           },
55 // CHECK-NEXT:           "start": {
56 // CHECK-NEXT:             "character": 36,
57 // CHECK-NEXT:             "line": 0
58 // CHECK-NEXT:           }
59 // CHECK-NEXT:         },
60 // CHECK-NEXT:         "severity": 1,
61 // CHECK-NEXT:         "source": "pdll"
62 // CHECK-NEXT:       }
63 // CHECK-NEXT:     ],
64 // CHECK-NEXT:     "uri": "test:///foo.pdll",
65 // CHECK-NEXT:     "version": 2
66 // CHECK-NEXT:   }
67 // -----
68 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
69   "uri":"test:///foo.pdll",
70   "version":3
71 }, "contentChanges": [
72   {
73     "range":{
74       "start":{"line":0,"character":30},
75       "end":{"line":0,"character":30}
76     },
77     "text": "(values: ValueRange)"
78   },
79   {
80     "range":{
81       "start":{"line":0,"character":56},
82       "end":{"line":0,"character":57}
83     },
84     "text": "values;"
85   }
86 ]}}
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
92 // CHECK-NEXT:   }
93 // -----
94 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
95 // -----
96 {"jsonrpc":"2.0","method":"exit"}