From 084df08d4e34dd1416d7e575663e092e5f8ec095 Mon Sep 17 00:00:00 2001 From: Charles Teague Date: Wed, 10 Jan 2024 08:45:02 -0500 Subject: [PATCH] Add rust comments to list of support languages --- src/core/jupyter/jupyter.ts | 1 + src/core/lib/partition-cell-options.ts | 1 + src/resources/filters/modules/constants.lua | 3 ++- src/resources/rmd/hooks.R | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/jupyter/jupyter.ts b/src/core/jupyter/jupyter.ts index 5acc4094fc..0a23db08a0 100644 --- a/src/core/jupyter/jupyter.ts +++ b/src/core/jupyter/jupyter.ts @@ -1175,6 +1175,7 @@ const kLangCommentChars: Record = { mermaid: "%%", apl: "⍝", ocaml: ["(*", "*)"], + rust: "//", }; function cleanJupyterOutputDisplayData( diff --git a/src/core/lib/partition-cell-options.ts b/src/core/lib/partition-cell-options.ts index 59795f894a..c066fe57a0 100644 --- a/src/core/lib/partition-cell-options.ts +++ b/src/core/lib/partition-cell-options.ts @@ -353,6 +353,7 @@ export const kLangCommentChars: Record = { ojs: "//", apl: "⍝", ocaml: ["(*", "*)"], + rust: "//", }; function escapeRegExp(str: string) { diff --git a/src/resources/filters/modules/constants.lua b/src/resources/filters/modules/constants.lua index d4953fbf74..e1702c270c 100644 --- a/src/resources/filters/modules/constants.lua +++ b/src/resources/filters/modules/constants.lua @@ -125,7 +125,8 @@ local kLangCommentChars = { markdown = {""}, gap = { "#" }, dockerfile = { "#" }, - ocaml = { "(*", "*)"} + ocaml = { "(*", "*)"}, + rust = { "// "} } local kDefaultCodeAnnotationComment = {"#"} diff --git a/src/resources/rmd/hooks.R b/src/resources/rmd/hooks.R index ab6bad4aed..6982d47280 100644 --- a/src/resources/rmd/hooks.R +++ b/src/resources/rmd/hooks.R @@ -956,7 +956,8 @@ engine_comment_chars <- function(engine) { haskell = "--", dot = "//", apl = "\u235D", - ocaml = c("(*", "*)") + ocaml = c("(*", "*)"), + rust = "//" ) comment_chars[[engine]] %||% "#" }