Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit 9c0a0b7

Browse files
committed
Return autocomplete documentation for items in markdown, just as for hover.
1 parent b43630d commit 9c0a0b7

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

src/rescript-editor-support/EditorSupportCommands.re

+13-7
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,19 @@ let autocomplete = (~currentFile, ~full, ~package, ~pos, ~state) => {
205205
("detail", NewCompletions.detail(name, item) |> s),
206206
(
207207
"documentation",
208-
s(
209-
(docstring |? "No docs")
210-
++ "\n\n"
211-
++ uri
212-
++ ":"
213-
++ string_of_int(pos_lnum),
214-
),
208+
o([
209+
("kind", s("markdown")),
210+
(
211+
"value",
212+
s(
213+
(docstring |? "No docs")
214+
++ "\n\n"
215+
++ uri
216+
++ ":"
217+
++ string_of_int(pos_lnum),
218+
),
219+
),
220+
]),
215221
),
216222
])
217223
})

src/rescript-editor-support/MessageHandlers.re

+13-7
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,19 @@ let handlers:
220220
("detail", NewCompletions.detail(name, item) |> s),
221221
(
222222
"documentation",
223-
s(
224-
(docstring |? "No docs")
225-
++ "\n\n"
226-
++ uri
227-
++ ":"
228-
++ string_of_int(pos_lnum),
229-
),
223+
o([
224+
("kind", s("markdown")),
225+
(
226+
"value",
227+
s(
228+
(docstring |? "No docs")
229+
++ "\n\n"
230+
++ uri
231+
++ ":"
232+
++ string_of_int(pos_lnum),
233+
),
234+
),
235+
]),
230236
),
231237
])
232238
),

0 commit comments

Comments
 (0)