From 01d870d767f32d65c8beb65d2fc1aec44bcc10ae Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Sun, 25 Apr 2021 18:05:59 +0200 Subject: [PATCH] Hover different on ocaml files. The hover command gives identical results for hover on doc comments in .res and .ml files. Hovever vscode shows markdown only for those from .res files. --- analysis/tests/src/Hover.res | 5 ++++- analysis/tests/src/OcamlFile.ml | 3 +++ analysis/tests/src/expected/Hover.res.txt | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 analysis/tests/src/OcamlFile.ml diff --git a/analysis/tests/src/Hover.res b/analysis/tests/src/Hover.res index 5a6501f36..6731fb20d 100644 --- a/analysis/tests/src/Hover.res +++ b/analysis/tests/src/Hover.res @@ -30,7 +30,7 @@ module HoverInsideModuleWithComponent = { let make = () => React.null } -@ocaml.doc("Doc comment for functionWithTypeAnnotation") +@ocaml.doc("Doc comment **for** functionWithTypeAnnotation") let functionWithTypeAnnotation : unit => int = () => 1 // ^hov @@ -44,3 +44,6 @@ let make2 = (~name:string) => React.string(name) let num = 34 // ^hov + +let withAnnot = OcamlFile.functionWithTypeAnnotation +// ^hov \ No newline at end of file diff --git a/analysis/tests/src/OcamlFile.ml b/analysis/tests/src/OcamlFile.ml new file mode 100644 index 000000000..53e230629 --- /dev/null +++ b/analysis/tests/src/OcamlFile.ml @@ -0,0 +1,3 @@ +let functionWithTypeAnnotation () = 1 +[@@ocaml.doc "Doc comment **for** functionWithTypeAnnotation"] + diff --git a/analysis/tests/src/expected/Hover.res.txt b/analysis/tests/src/expected/Hover.res.txt index 7a0e4f5fe..93dbbad40 100644 --- a/analysis/tests/src/expected/Hover.res.txt +++ b/analysis/tests/src/expected/Hover.res.txt @@ -17,7 +17,7 @@ Hover tests/src/Hover.res 26:6 {"contents": "```rescript\nint\n```"} Hover tests/src/Hover.res 33:4 -{"contents": "```rescript\nunit => int\n```\n\nDoc comment for functionWithTypeAnnotation"} +{"contents": "```rescript\nunit => int\n```\n\nDoc comment **for** functionWithTypeAnnotation"} Hover tests/src/Hover.res 37:13 {"contents": "```rescript\nstring\n```"} @@ -28,3 +28,6 @@ Hover tests/src/Hover.res 41:13 Hover tests/src/Hover.res 44:10 {"contents": "```rescript\nint\n```"} +Hover tests/src/Hover.res 47:29 +{"contents": "```rescript\nunit => int\n```\n\nDoc comment **for** functionWithTypeAnnotation"} +