1 // RUN: tblgen-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"tablegen","capabilities":{},"trace":"off"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5 "uri":"test:///foo.td",
6 "languageId":"tablegen",
10 // CHECK: "method": "textDocument/publishDiagnostics",
11 // CHECK-NEXT: "params": {
12 // CHECK-NEXT: "diagnostics": [
14 // CHECK-NEXT: "category": "Parse Error",
15 // CHECK-NEXT: "message": "Unknown token when expecting a type",
16 // CHECK-NEXT: "range": {
17 // CHECK-NEXT: "end": {
18 // CHECK-NEXT: "character": 11,
19 // CHECK-NEXT: "line": 0
21 // CHECK-NEXT: "start": {
22 // CHECK-NEXT: "character": 10,
23 // CHECK-NEXT: "line": 0
26 // CHECK-NEXT: "severity": 1,
27 // CHECK-NEXT: "source": "tablegen"
30 // CHECK-NEXT: "uri": "test:///foo.td",
31 // CHECK-NEXT: "version": 1
34 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
35 "uri":"test:///foo.td",
37 }, "contentChanges": [{
39 "start":{"line":0,"character":10},
40 "end":{"line":0,"character":10}
44 // CHECK: "method": "textDocument/publishDiagnostics",
45 // CHECK-NEXT: "params": {
46 // CHECK-NEXT: "diagnostics": [
48 // CHECK-NEXT: "category": "Parse Error",
49 // CHECK-NEXT: "message": "Expected identifier in declaration",
50 // CHECK-NEXT: "range": {
51 // CHECK-NEXT: "end": {
52 // CHECK-NEXT: "character": 14,
53 // CHECK-NEXT: "line": 0
55 // CHECK-NEXT: "start": {
56 // CHECK-NEXT: "character": 13,
57 // CHECK-NEXT: "line": 0
60 // CHECK-NEXT: "severity": 1,
61 // CHECK-NEXT: "source": "tablegen"
64 // CHECK-NEXT: "uri": "test:///foo.td",
65 // CHECK-NEXT: "version": 2
68 {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{
69 "uri":"test:///foo.td",
71 }, "contentChanges": [
74 "start":{"line":0,"character":13},
75 "end":{"line":0,"character":13}
81 "start":{"line":0,"character":15},
82 "end":{"line":0,"character":17}
84 "text": "> { int x = i; }"
87 // CHECK: "method": "textDocument/publishDiagnostics",
88 // CHECK-NEXT: "params": {
89 // CHECK-NEXT: "diagnostics": [],
90 // CHECK-NEXT: "uri": "test:///foo.td",
91 // CHECK-NEXT: "version": 3
94 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
96 {"jsonrpc":"2.0","method":"exit"}