Skip to content

Commit 6b82359

Browse files
committed
Restore inlay hints for templates
Signed-off-by: Christoph Knittel <ck@cca.io>
1 parent 4196be1 commit 6b82359

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

analysis/src/hint.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ let inlay ~source ~kind_file ~pos ~max_length ~full ~state ~debug =
6161
( Pexp_constant _ | Pexp_tuple _ | Pexp_record _ | Pexp_variant _
6262
| Pexp_apply _ | Pexp_match _ | Pexp_construct _ | Pexp_ifthenelse _
6363
| Pexp_array _ | Pexp_ident _ | Pexp_try _ | Pexp_object_get _
64-
| Pexp_object_set _ | Pexp_field _ | Pexp_open _ | Pexp_fun _ );
64+
| Pexp_object_set _ | Pexp_field _ | Pexp_open _ | Pexp_fun _
65+
| Pexp_template _ | Pexp_tagged_template _ );
6566
};
6667
} ->
6768
push vb.pvb_pat.ppat_loc Type
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@module("tag")
2+
external tag: taggedTemplate<string, string> = "default"
3+
4+
let value = "x"
5+
let template = `value: ${value}`
6+
let tagged = tag`value: ${value}`
7+
8+
//^hin
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Inlay Hint src/InlayHintTemplate.res 1:34
2+
[
3+
{
4+
"kind": 1,
5+
"label": ": string",
6+
"paddingLeft": true,
7+
"paddingRight": false,
8+
"position": { "character": 10, "line": 5 }
9+
},
10+
{
11+
"kind": 1,
12+
"label": ": string",
13+
"paddingLeft": true,
14+
"paddingRight": false,
15+
"position": { "character": 12, "line": 4 }
16+
},
17+
{
18+
"kind": 1,
19+
"label": ": string",
20+
"paddingLeft": true,
21+
"paddingRight": false,
22+
"position": { "character": 9, "line": 3 }
23+
}
24+
]
25+

0 commit comments

Comments
 (0)