Skip to content

Commit 6c21bd8

Browse files
authored
nixd/Controller: precommit test for #629 (#685)
1 parent aa00c2a commit 6c21bd8

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# RUN: nixd --lit-test \
2+
# RUN: --nixpkgs-expr="{ hello.meta.description = \"Very Nice\"; }" \
3+
# RUN: < %s | FileCheck %s
4+
5+
<-- initialize(0)
6+
7+
```json
8+
{
9+
"jsonrpc":"2.0",
10+
"id":0,
11+
"method":"initialize",
12+
"params":{
13+
"processId":123,
14+
"rootPath":"",
15+
"capabilities":{
16+
},
17+
"trace":"off"
18+
}
19+
}
20+
```
21+
22+
23+
<-- textDocument/didOpen
24+
25+
26+
```nix file:///test.nix
27+
pkgs.foo
28+
```
29+
30+
<-- textDocument/hover(2)
31+
32+
33+
```json
34+
{
35+
"jsonrpc":"2.0",
36+
"id":2,
37+
"method":"textDocument/hover",
38+
"params":{
39+
"textDocument":{
40+
"uri":"file:///test.nix"
41+
},
42+
"position":{
43+
"line":0,
44+
"character":6
45+
}
46+
}
47+
}
48+
```
49+
50+
```
51+
CHECK: "contents": {
52+
CHECK-NEXT: "kind": "markdown",
53+
CHECK-NEXT: "value": "`Identifier`"
54+
CHECK-NEXT: },
55+
CHECK-NEXT: "range": {
56+
CHECK-NEXT: "end": {
57+
CHECK-NEXT: "character": 8,
58+
CHECK-NEXT: "line": 0
59+
CHECK-NEXT: },
60+
CHECK-NEXT: "start": {
61+
CHECK-NEXT: "character": 5,
62+
CHECK-NEXT: "line": 0
63+
CHECK-NEXT: }
64+
CHECK-NEXT: }
65+
```

0 commit comments

Comments
 (0)