Skip to content

Commit 40785b4

Browse files
authored
Standardise UI messages to use quotes instead of Markdown backticks (#1926)
* Standardise UI messages to use quotes instead of Markdown backticks Replace Markdown-style backticks in notifications and message popups with double quotes, since VSCode does not render Markdown in showInformationMessage/showWarningMessage/showErrorMessage. Signed-off-by: Sora Morimoto <[email protected]> * Update CHANGELOG.md Signed-off-by: Sora Morimoto <[email protected]> * dune fmt Signed-off-by: Sora Morimoto <[email protected]> --------- Signed-off-by: Sora Morimoto <[email protected]>
1 parent 15f1680 commit 40785b4

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
`utop --version`, `ocamlearlybird --help`, `odig --version`,
1616
`ocamlobjinfo <file>`). This ensures commands resolve correctly under Dune
1717
Package Management. (#1925)
18+
- Replace Markdown backticks in notifications and message popups with double
19+
quotes, since VS Code does not render Markdown in
20+
`showInformationMessage`/`showWarningMessage`/`showErrorMessage`. (#1926)
1821

1922
## 1.32.0
2023

src/extension_commands.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ let _install_dune_lsp_server =
108108
let options =
109109
ProgressOptions.create
110110
~location:(`ProgressLocation Notification)
111-
~title:"Installing ocaml-lsp server using `dune tools install ocamllsp`"
111+
~title:"Installing ocaml-lsp server using \"dune tools install ocamllsp\""
112112
~cancellable:false
113113
()
114114
in
@@ -152,7 +152,7 @@ let _run_dune_pkg_lock =
152152
let options =
153153
ProgressOptions.create
154154
~location:(`ProgressLocation Notification)
155-
~title:"Running `dune pkg lock`"
155+
~title:"Running \"dune pkg lock\""
156156
~cancellable:false
157157
()
158158
in
@@ -376,7 +376,7 @@ end = struct
376376
| Error (`Msg msg) ->
377377
show_message
378378
`Warn
379-
"The installed version of `ocamllsp` does not support typed holes. %s"
379+
"The installed version of \"ocamllsp\" does not support typed holes. %s"
380380
msg
381381
;;
382382

@@ -602,7 +602,7 @@ module Copy_type_under_cursor = struct
602602
| Error (`Msg msg) ->
603603
show_message
604604
`Warn
605-
"The installed version of `ocamllsp` does not support type enclosings. %s"
605+
"The installed version of \"ocamllsp\" does not support type enclosings. %s"
606606
msg
607607
;;
608608

@@ -1144,7 +1144,7 @@ module Search_by_type = struct
11441144
let _ =
11451145
Ocaml_lsp.suggest_to_upgrade_ocaml_lsp_server
11461146
~message:
1147-
"The installed version of `ocamllsp` does not support type search."
1147+
"The installed version of \"ocamllsp\" does not support type search."
11481148
()
11491149
in
11501150
()

src/extension_instance.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ let check_ocaml_lsp_available (sandbox : Sandbox.t) =
144144
let+ dune_lsp_present = Dune.is_ocamllsp_present dune in
145145
if dune_lsp_present
146146
then Ok ()
147-
else Error "`ocaml-lsp-server` is not installed in the current dune sandbox."
147+
else Error "\"ocaml-lsp-server\" is not installed in the current dune sandbox."
148148
| _ ->
149149
let ocaml_lsp_version sandbox =
150150
Sandbox.get_command sandbox "ocamllsp" [ "--version" ] `Tool
@@ -154,7 +154,7 @@ let check_ocaml_lsp_available (sandbox : Sandbox.t) =
154154
|> Promise.Result.fold
155155
~ok:(fun (_ : string) -> ())
156156
~error:(fun (_ : string) ->
157-
"Sandbox initialization failed: `ocaml-lsp-server` is not installed in the \
157+
"Sandbox initialization failed: \"ocaml-lsp-server\" is not installed in the \
158158
current sandbox.")
159159
;;
160160

@@ -212,8 +212,8 @@ end = struct
212212
let* selection =
213213
Window.showInformationMessage
214214
~message:
215-
"Failed to start the language server. `ocaml-lsp-server` is not installed in \
216-
the current sandbox."
215+
"Failed to start the language server. \"ocaml-lsp-server\" is not installed \
216+
in the current sandbox."
217217
~choices:
218218
[ install_lsp_text, `Install_lsp; select_different_sandbox, `Select_sandbox ]
219219
()
@@ -278,7 +278,7 @@ end = struct
278278
| Error s ->
279279
show_message
280280
`Error
281-
"An error occurred starting the language server `ocamllsp`. %s"
281+
"An error occurred starting the language server \"ocamllsp\". %s"
282282
s)
283283
| Error _ -> suggest_or_install_ocaml_lsp_server t
284284
;;
@@ -435,7 +435,7 @@ let update_ocaml_info t =
435435
log_chan
436436
~section:"Ocaml.version_semver"
437437
`Warn
438-
"Error running `ocamlc -version`: %s"
438+
"Error running \"ocamlc -version\": %s"
439439
e;
440440
Error `Ocamlc_missing
441441
in
@@ -449,7 +449,7 @@ let update_ocaml_info t =
449449
| `Unable_to_parse_version (`Version v, `Msg msg) ->
450450
show_message
451451
`Error
452-
"OCaml bytecode compiler `ocamlc` version could not be parsed. Version: %s. \
452+
"OCaml bytecode compiler \"ocamlc\" version could not be parsed. Version: %s. \
453453
Error %s"
454454
v
455455
msg
@@ -458,7 +458,7 @@ let update_ocaml_info t =
458458
let+ maybe_choice =
459459
Window.showWarningMessage
460460
~message:
461-
"OCaml bytecode compiler `ocamlc` was not found in the current sandbox. \
461+
"OCaml bytecode compiler \"ocamlc\" was not found in the current sandbox. \
462462
Do you have OCaml installed in the current sandbox?"
463463
~choices:
464464
[ ( "Pick another sandbox"

src/type_selection.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ let ocaml_lsp_doesnt_support_type_selection instance ocaml_lsp =
5454
| Error (`Msg msg) ->
5555
show_message
5656
`Warn
57-
"The installed version of `ocamllsp` does not support type enclosings. %s"
57+
"The installed version of \"ocamllsp\" does not support type enclosings. %s"
5858
msg
5959
;;
6060

0 commit comments

Comments
 (0)