Skip to content

Commit b3df7b2

Browse files
committed
skeleton for extracting clickable links in hovers
1 parent 3bbdbee commit b3df7b2

File tree

11 files changed

+115
-42
lines changed

11 files changed

+115
-42
lines changed

analysis/src/Hover.ml

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@ open SharedTypes
22

33
let codeBlock code = Printf.sprintf "```rescript\n%s\n```" code
44

5+
let encodeURIComponent text =
6+
let ln = String.length text in
7+
let buf = Buffer.create ln in
8+
let rec loop i =
9+
if i < ln then (
10+
(match text.[i] with
11+
| '"' -> Buffer.add_string buf "%22"
12+
| ':' -> Buffer.add_string buf "%3A"
13+
| '/' -> Buffer.add_string buf "%2F"
14+
| '\\' -> Buffer.add_string buf "%5C"
15+
| ',' -> Buffer.add_string buf "%2C"
16+
| '&' -> Buffer.add_string buf "%26"
17+
| '[' -> Buffer.add_string buf "%5B"
18+
| ']' -> Buffer.add_string buf "%5D"
19+
| c -> Buffer.add_char buf c);
20+
loop (i + 1))
21+
in
22+
loop 0;
23+
Buffer.contents buf
24+
25+
type link = {range: Protocol.range; file: string; label: string}
26+
27+
let linkToCommandArgs link =
28+
Printf.sprintf "[\"%s\",%i,%i,%i,%i]" link.file link.range.start.character
29+
link.range.start.line link.range.end_.character link.range.end_.line
30+
31+
let makeGotoCommand link =
32+
Printf.sprintf "[%s](command:rescript-vscode.go_to_location?%s)" link.label
33+
(encodeURIComponent (linkToCommandArgs link))
34+
535
let showModuleTopLevel ~docstring ~name (topLevel : Module.item list) =
636
let contents =
737
topLevel
@@ -145,20 +175,37 @@ let newHover ~full:{file; package} locItem =
145175
constructors |> List.filter_map (fromConstructorPath ~env:envToSearch)
146176
in
147177
let typeString = typeString :: typeDefinitions |> String.concat "\n\n" in
148-
(typeString, docstring)
178+
let links =
179+
"\n---\nGo to: "
180+
^ ([
181+
makeGotoCommand
182+
{
183+
label = "SomeModule";
184+
file =
185+
"file:///Users/zth/git/rescript-vscode-official/analysis/examples/example-project/src/Json.res";
186+
range =
187+
{
188+
start = {character = 0; line = 34};
189+
end_ = {character = 0; line = 42};
190+
};
191+
};
192+
]
193+
|> String.concat " | ")
194+
in
195+
(typeString, docstring, links)
149196
in
150197
let parts =
151198
match References.definedForLoc ~file ~package locKind with
152199
| None ->
153-
let typeString, docstring = t |> fromType ~docstring:[] in
154-
typeString :: docstring
200+
let typeString, docstring, links = t |> fromType ~docstring:[] in
201+
List.concat [[typeString]; docstring; [links]]
155202
| Some (docstring, res) -> (
156203
match res with
157204
| `Declared ->
158-
let typeString, docstring = t |> fromType ~docstring in
159-
typeString :: docstring
205+
let typeString, docstring, links = t |> fromType ~docstring in
206+
List.concat [[typeString]; docstring; [links]]
160207
| `Constructor {cname = {txt}; args} ->
161-
let typeString, docstring = t |> fromType ~docstring in
208+
let typeString, docstring, links = t |> fromType ~docstring in
162209
let argsString =
163210
match args with
164211
| [] -> ""
@@ -167,9 +214,10 @@ let newHover ~full:{file; package} locItem =
167214
|> List.map (fun (t, _) -> Shared.typeToString t)
168215
|> String.concat ", " |> Printf.sprintf "(%s)"
169216
in
170-
typeString :: codeBlock (txt ^ argsString) :: docstring
217+
List.concat
218+
[[typeString; codeBlock (txt ^ argsString)]; docstring; [links]]
171219
| `Field ->
172-
let typeString, docstring = t |> fromType ~docstring in
173-
typeString :: docstring)
220+
let typeString, docstring, links = t |> fromType ~docstring in
221+
List.concat [[typeString]; docstring; [links]])
174222
in
175223
Some (String.concat "\n\n" parts)

analysis/src/Uri.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ val stripPath : bool ref
66
val toPath : t -> string
77
val toString : t -> string
88
val toTopLevelLoc : t -> Location.t
9+
val pathToUri : string -> string
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Hover src/Auto.res 2:13
2-
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n```rescript\ntype t<'a> = list<'a>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}
2+
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n```rescript\ntype t<'a> = list<'a>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
33

analysis/tests/src/expected/Definition.res.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Definition src/Definition.res 10:23
55
{"uri": "Definition.res", "range": {"start": {"line": 6, "character": 7}, "end": {"line": 6, "character": 13}}}
66

77
Hover src/Definition.res 14:14
8-
{"contents": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],\n and builds the list [[f a1; ...; f an]]\n with the results returned by [f]. Not tail-recursive. "}
8+
{"contents": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n [List.map f [a1; ...; an]] applies function [f] to [a1, ..., an],\n and builds the list [[f a1; ...; f an]]\n with the results returned by [f]. Not tail-recursive. \n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
99

1010
Hover src/Definition.res 18:14
11-
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n```rescript\ntype t<'a> = list<'a>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n"}
11+
{"contents": "```rescript\n(Belt.List.t<'a>, 'a => 'b) => Belt.List.t<'b>\n```\n\n```rescript\ntype t<'a> = list<'a>\n```\n\n\n Returns a new list with `f` applied to each element of `someList`.\n\n ```res example\n list{1, 2}->Belt.List.map(x => x + 1) // list{3, 4}\n ```\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
1212

1313
Hover src/Definition.res 23:3
14-
{"contents": "```rescript\n(. int, int) => int\n```"}
14+
{"contents": "```rescript\n(. int, int) => int\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
1515

1616
Definition src/Definition.res 26:3
1717
{"uri": "Definition.res", "range": {"start": {"line": 21, "character": 4}, "end": {"line": 21, "character": 13}}}

analysis/tests/src/expected/Div.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Hover src/Div.res 0:10
22
getLocItem #3: heuristic for <div>
3-
{"contents": "```rescript\n(\n string,\n ~props: ReactDOMRe.domProps=?,\n array<React.element>,\n) => React.element\n```\n\n```rescript\ntype domProps = ReactDOM.Props.domProps\n```\n\n```rescript\ntype element\n```"}
3+
{"contents": "```rescript\n(\n string,\n ~props: ReactDOMRe.domProps=?,\n array<React.element>,\n) => React.element\n```\n\n```rescript\ntype domProps = ReactDOM.Props.domProps\n```\n\n```rescript\ntype element\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
44

55
Complete src/Div.res 3:17
66
posCursor:[3:17] posNoWhite:[3:16] Found expr:[3:4->3:17]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Hover src/DocComments.res 9:9
2-
{"contents": "```rescript\nint\n```\n\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n"}
2+
{"contents": "```rescript\nint\n```\n\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n /*\\n * stuff\\n */\\n ```\\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
33

44
Hover src/DocComments.res 22:6
5-
{"contents": "```rescript\nint\n```\n\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n"}
5+
{"contents": "```rescript\nint\n```\n\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n /*\n * stuff\n */\n ```\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
66

77
Hover src/DocComments.res 33:9
8-
{"contents": "```rescript\nint\n```\n\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n"}
8+
{"contents": "```rescript\nint\n```\n\n Doc comment with a triple-backquote example\\n \\n ```res example\\n let a = 10\\n let b = 20\\n ```\\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
99

1010
Hover src/DocComments.res 44:6
11-
{"contents": "```rescript\nint\n```\n\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n"}
11+
{"contents": "```rescript\nint\n```\n\n\n Doc comment with a triple-backquote example\n \n ```res example\n let a = 10\n let b = 20\n ```\n\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
1212

analysis/tests/src/expected/Fragment.res.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Hover src/Fragment.res 6:19
22
getLocItem #4: heuristic for </Comp> within fragments: take make as makeProps does not work
33
the type is not great but jump to definition works
4-
{"contents": "```rescript\nReact.component<{\"children\": React.element}>\n```\n\n```rescript\ntype component<'props> = componentLike<'props, element>\n```"}
4+
{"contents": "```rescript\nReact.component<{\"children\": React.element}>\n```\n\n```rescript\ntype component<'props> = componentLike<'props, element>\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
55

66
Hover src/Fragment.res 9:56
77
Nothing at that position. Now trying to use completion.

analysis/tests/src/expected/Hover.res.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Hover src/Hover.res 0:4
2-
{"contents": "```rescript\nint\n```"}
2+
{"contents": "```rescript\nint\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
33

44
Hover src/Hover.res 3:5
55
{"contents": "```rescript\ntype t = (int, float)\n```"}
@@ -11,20 +11,20 @@ Hover src/Hover.res 19:11
1111
{"contents": "\nThis module is commented\n```rescript\nmodule Dep = {\n let customDouble: int => int\n}\n```"}
1212

1313
Hover src/Hover.res 22:11
14-
{"contents": "```rescript\nint => int\n```\n\nSome doc comment"}
14+
{"contents": "```rescript\nint => int\n```\n\nSome doc comment\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
1515

1616
Hover src/Hover.res 26:6
17-
{"contents": "```rescript\nint\n```"}
17+
{"contents": "```rescript\nint\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
1818

1919
Hover src/Hover.res 33:4
20-
{"contents": "```rescript\nunit => int\n```\n\nDoc comment for functionWithTypeAnnotation"}
20+
{"contents": "```rescript\nunit => int\n```\n\nDoc comment for functionWithTypeAnnotation\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
2121

2222
Hover src/Hover.res 37:13
2323
getLocItem #5: heuristic for JSX and compiler combined:
2424
~x becomes Props#x
2525
heuristic for: [Props, x], give loc of `x`
2626
n1:Props n2:name
27-
{"contents": "```rescript\nstring\n```"}
27+
{"contents": "```rescript\nstring\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
2828

2929
Hover src/Hover.res 42:15
3030
getLocItem #7: heuristic for JSX on type-annotated labeled (~arg:t):
@@ -33,7 +33,7 @@ Props has the location range of arg:t
3333
arg has the location range of arg
3434
heuristic for: [Props, arg], give loc of `arg`
3535
n1:Props n2:name
36-
{"contents": "```rescript\nstring\n```"}
36+
{"contents": "```rescript\nstring\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
3737

3838
Hover src/Hover.res 46:10
3939
{"contents": "```rescript\nint\n```"}
@@ -69,16 +69,16 @@ JSX <Comp1:[95:3->95:8] > _children:95:8
6969
null
7070

7171
Hover src/Hover.res 103:25
72-
{"contents": "```rescript\nfloat\n```"}
72+
{"contents": "```rescript\nfloat\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
7373

7474
Hover src/Hover.res 106:21
75-
{"contents": "```rescript\nint\n```"}
75+
{"contents": "```rescript\nint\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
7676

7777
Hover src/Hover.res 116:16
78-
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```\n\n```rescript\ntype cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```"}
78+
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```\n\n```rescript\ntype cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
7979

8080
Hover src/Hover.res 119:25
81-
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```\n\n```rescript\ntype cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```"}
81+
{"contents": "```rescript\nAA.cond<[< #str(string)]> => AA.cond<[< #str(string)]>\n```\n\n```rescript\ntype cond<'a> = 'a\n constraint 'a = [< #str(string)]\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
8282

8383
Hover src/Hover.res 122:3
8484
Nothing at that position. Now trying to use completion.
@@ -87,28 +87,28 @@ Completable: Cdecorator(live)
8787
{"contents": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}
8888

8989
Hover src/Hover.res 125:4
90-
{"contents": "```rescript\n(. ()) => unit => int\n```"}
90+
{"contents": "```rescript\n(. ()) => unit => int\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
9191

9292
Hover src/Hover.res 131:4
93-
{"contents": "```rescript\n(. ()) => (. ()) => int\n```"}
93+
{"contents": "```rescript\n(. ()) => (. ()) => int\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
9494

9595
Hover src/Hover.res 134:4
96-
{"contents": "```rescript\n(. unit, unit) => int\n```"}
96+
{"contents": "```rescript\n(. unit, unit) => int\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
9797

9898
Hover src/Hover.res 137:5
99-
{"contents": "```rescript\n(. ()) => unit => int\n```"}
99+
{"contents": "```rescript\n(. ()) => unit => int\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
100100

101101
Hover src/Hover.res 144:9
102-
{"contents": "```rescript\nint\n```\n\ndoc comment 1"}
102+
{"contents": "```rescript\nint\n```\n\ndoc comment 1\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
103103

104104
Hover src/Hover.res 148:6
105-
{"contents": "```rescript\nint\n```\n\n doc comment 2 "}
105+
{"contents": "```rescript\nint\n```\n\n doc comment 2 \n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
106106

107107
Hover src/Hover.res 165:23
108-
{"contents": "```rescript\nfoo<bar>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\n\n```rescript\ntype bar = {age: int}\n```"}
108+
{"contents": "```rescript\nfoo<bar>\n```\n\n```rescript\ntype foo<'a> = {content: 'a, zzz: string}\n```\n\n```rescript\ntype bar = {age: int}\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
109109

110110
Hover src/Hover.res 167:22
111-
{"contents": "```rescript\nfoobar\n```\n\n```rescript\ntype foobar = foo<bar>\n```"}
111+
{"contents": "```rescript\nfoobar\n```\n\n```rescript\ntype foobar = foo<bar>\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
112112

113113
Complete src/Hover.res 170:16
114114
posCursor:[170:16] posNoWhite:[170:15] Found expr:[170:5->170:16]
@@ -159,8 +159,8 @@ Completable: Cpath Value[y2].content.""
159159
}]
160160

161161
Hover src/Hover.res 197:4
162-
{"contents": "```rescript\nCompV4.props<int, string> => React.element\n```\n\n```rescript\ntype props<'n, 's> = {?n: 'n, s: 's}\n```\n\n```rescript\ntype element\n```"}
162+
{"contents": "```rescript\nCompV4.props<int, string> => React.element\n```\n\n```rescript\ntype props<'n, 's> = {?n: 'n, s: 's}\n```\n\n```rescript\ntype element\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
163163

164164
Hover src/Hover.res 202:16
165-
{"contents": "```rescript\nuseR\n```\n\n```rescript\ntype useR = {x: int, y: list<option<r<float>>>}\n```\n\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```"}
165+
{"contents": "```rescript\nuseR\n```\n\n```rescript\ntype useR = {x: int, y: list<option<r<float>>>}\n```\n\n```rescript\ntype r<'a> = {i: 'a, f: float}\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
166166

analysis/tests/src/expected/Jsx2.resi.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Hover src/Jsx2.resi 1:4
22
getLocItem #1: heuristic for makeProps in interface files
33
n1:componentLike n2:unit n3:string
4-
{"contents": "```rescript\n(~first: string, ~key: string=?, unit) => {\"first\": string}\n```"}
4+
{"contents": "```rescript\n(~first: string, ~key: string=?, unit) => {\"first\": string}\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
55

66
Hover src/Jsx2.resi 4:4
7-
{"contents": "```rescript\nint\n```"}
7+
{"contents": "```rescript\nint\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
88

99
Complete src/Jsx2.resi 7:19
1010
posCursor:[7:19] posNoWhite:[7:18] Found type:[7:12->7:19]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Hover src/LongIdentTest.res 2:13
2-
{"contents": "```rescript\nint\n```"}
2+
{"contents": "```rescript\nint\n```\n\n[SomeModule](command:rescript-vscode.go_to_location?%5B%22file%3A%2F%2Fwhatever%2Ffolder%2FSomeModule.res%22%2C0%2C0%2C0%2C0%5D)"}
33

0 commit comments

Comments
 (0)