Skip to content

Commit cfda19d

Browse files
authored
hotfix to unbreak syntax highlighting (#692)
hotfix to unbreak syntax highlighting
1 parent 2ee8f68 commit cfda19d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/xinterpreter.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,21 @@ namespace xpyt
310310
"text/x-python", // language_mimetype
311311
".py", // language_file_extension
312312
"ipython" + std::to_string(PY_MAJOR_VERSION), // pygments_lexer
313-
R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}", // language_codemirror_mode
313+
R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}",
314314
"python", // language_nbconvert_exporter
315315
banner, // banner
316-
has_debugger, // debugger
316+
has_debugger, // debugger
317317
help_links // help_links
318318
);
319-
319+
// use a dict, string seems to be not supported by the frontend
320+
rep["language_info"]["codemirror_mode"] = nl::json::object({
321+
{"name", "ipython"},
322+
{"version", PY_MAJOR_VERSION}
323+
});
320324
if (has_debugger)
321325
{
322326
rep["supported_features"] = nl::json::array({"debugger"});
323327
}
324-
325328
return rep;
326329
}
327330

0 commit comments

Comments
 (0)