1 // RUN: tblgen-lsp-server -lit-test < %s | FileCheck %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",
8 "text":"class Foo {\n int field1 = ?;\n}\ndef FooDerived : Foo {\n let field1 = 10;\n }\n"
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{
12 "textDocument":{"uri":"test:///foo.td"},
13 "position":{"line":3,"character":19}
16 // CHECK-NEXT: "jsonrpc": "2.0",
17 // CHECK-NEXT: "result": [
19 // CHECK-NEXT: "range": {
20 // CHECK-NEXT: "end": {
21 // CHECK-NEXT: "character": 9,
22 // CHECK-NEXT: "line": 0
24 // CHECK-NEXT: "start": {
25 // CHECK-NEXT: "character": 6,
26 // CHECK-NEXT: "line": 0
29 // CHECK-NEXT: "uri": "{{.*}}/foo.td"
32 {"jsonrpc":"2.0","id":2,"method":"textDocument/definition","params":{
33 "textDocument":{"uri":"test:///foo.td"},
34 "position":{"line":4,"character":9}
37 // CHECK-NEXT: "jsonrpc": "2.0",
38 // CHECK-NEXT: "result": [
40 // CHECK-NEXT: "range": {
41 // CHECK-NEXT: "end": {
42 // CHECK-NEXT: "character": 12,
43 // CHECK-NEXT: "line": 1
45 // CHECK-NEXT: "start": {
46 // CHECK-NEXT: "character": 6,
47 // CHECK-NEXT: "line": 1
50 // CHECK-NEXT: "uri": "{{.*}}/foo.td"
53 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
55 {"jsonrpc":"2.0","method":"exit"}