1 // RUN: tblgen-lsp-server -tablegen-extra-dir %S -tablegen-extra-dir %S/../../include -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":"include \"include/included.td\"\n// This is a def.\ndef Def : IncludedClass;\nclass Class<IncludedClass c> {\n int arg = c.arg;\n}\n"
11 // Hover on an include file.
12 {"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{
13 "textDocument":{"uri":"test:///foo.td"},
14 "position":{"line":0,"character":15}
17 // CHECK-NEXT: "jsonrpc": "2.0",
18 // CHECK-NEXT: "result": {
19 // CHECK-NEXT: "contents": {
20 // CHECK-NEXT: "kind": "markdown",
21 // CHECK-NEXT: "value": "`included.td`\n***\n{{.*}}included.td"
23 // CHECK-NEXT: "range": {
24 // CHECK-NEXT: "end": {
25 // CHECK-NEXT: "character": 29,
26 // CHECK-NEXT: "line": 0
28 // CHECK-NEXT: "start": {
29 // CHECK-NEXT: "character": 8,
30 // CHECK-NEXT: "line": 0
36 {"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{
37 "textDocument":{"uri":"test:///foo.td"},
38 "position":{"line":2,"character":6}
41 // CHECK-NEXT: "jsonrpc": "2.0",
42 // CHECK-NEXT: "result": {
43 // CHECK-NEXT: "contents": {
44 // CHECK-NEXT: "kind": "markdown",
45 // CHECK-NEXT: "value": "**def** `Def`\n***\n\n This is a def.\n"
47 // CHECK-NEXT: "range": {
48 // CHECK-NEXT: "end": {
49 // CHECK-NEXT: "character": 7,
50 // CHECK-NEXT: "line": 2
52 // CHECK-NEXT: "start": {
53 // CHECK-NEXT: "character": 4,
54 // CHECK-NEXT: "line": 2
60 {"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{
61 "textDocument":{"uri":"test:///foo.td"},
62 "position":{"line":4,"character":16}
65 // CHECK-NEXT: "jsonrpc": "2.0",
66 // CHECK-NEXT: "result": {
67 // CHECK-NEXT: "contents": {
68 // CHECK-NEXT: "kind": "markdown",
69 // CHECK-NEXT: "value": "**field** `arg`\n***\nType: `int`\n***\n\n This argument was defined on an included class.\n\n***\n"
71 // CHECK-NEXT: "range": {
72 // CHECK-NEXT: "end": {
73 // CHECK-NEXT: "character": 17,
74 // CHECK-NEXT: "line": 4
76 // CHECK-NEXT: "start": {
77 // CHECK-NEXT: "character": 14,
78 // CHECK-NEXT: "line": 4
83 {"jsonrpc":"2.0","id":7,"method":"shutdown"}
85 {"jsonrpc":"2.0","method":"exit"}