[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / tblgen-lsp-server / hover.test
blob4e3c9a6b46eda0f7e4bf0c501b746d69a11fe8f9
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"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.td",
6   "languageId":"tablegen",
7   "version":1,
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"
9 }}}
10 // -----
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}
16 //      CHECK:  "id": 1,
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"
22 // CHECK-NEXT:    },
23 // CHECK-NEXT:    "range": {
24 // CHECK-NEXT:      "end": {
25 // CHECK-NEXT:        "character": 29,
26 // CHECK-NEXT:        "line": 0
27 // CHECK-NEXT:      },
28 // CHECK-NEXT:      "start": {
29 // CHECK-NEXT:        "character": 8,
30 // CHECK-NEXT:        "line": 0
31 // CHECK-NEXT:      }
32 // CHECK-NEXT:    }
33 // CHECK-NEXT:  }
34 // -----
35 // Hover on a record.
36 {"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{
37   "textDocument":{"uri":"test:///foo.td"},
38   "position":{"line":2,"character":6}
40 //      CHECK:  "id": 1,
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"
46 // CHECK-NEXT:    },
47 // CHECK-NEXT:    "range": {
48 // CHECK-NEXT:      "end": {
49 // CHECK-NEXT:        "character": 7,
50 // CHECK-NEXT:        "line": 2
51 // CHECK-NEXT:      },
52 // CHECK-NEXT:      "start": {
53 // CHECK-NEXT:        "character": 4,
54 // CHECK-NEXT:        "line": 2
55 // CHECK-NEXT:      }
56 // CHECK-NEXT:    }
57 // CHECK-NEXT:  }
58 // -----
59 // Hover on a record.
60 {"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{
61   "textDocument":{"uri":"test:///foo.td"},
62   "position":{"line":4,"character":16}
64 //      CHECK:  "id": 1,
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"
70 // CHECK-NEXT:    },
71 // CHECK-NEXT:    "range": {
72 // CHECK-NEXT:      "end": {
73 // CHECK-NEXT:        "character": 17,
74 // CHECK-NEXT:        "line": 4
75 // CHECK-NEXT:      },
76 // CHECK-NEXT:      "start": {
77 // CHECK-NEXT:        "character": 14,
78 // CHECK-NEXT:        "line": 4
79 // CHECK-NEXT:      }
80 // CHECK-NEXT:    }
81 // CHECK-NEXT:  }
82 // -----
83 {"jsonrpc":"2.0","id":7,"method":"shutdown"}
84 // -----
85 {"jsonrpc":"2.0","method":"exit"}