Skip to content

A proper mixed codemirror mode #52

@BoPeng

Description

@BoPeng

The SoS CodeMirror mode, as defined in kernel.js, is a Python mode + magic and SoS statements. It does not highlight code in other languages correctly. In theory, we should

  1. use R code mirror mode (plus magics) for R cells, and so on.
  2. Recognize SoS actions and highlight lines after R: as R code etc. It should in theory also recognize expand=True etc to correctly identify and highlight SoS expressions.

Item 1 could be done when the language of a cell is switched. We should be able to create new codemirror mode and switch to it. There is however a slight problem with the name of the language (e.g. R) might not match name of code mirror.

Item 2 could be done with nested codemirror mode, and there are examples such as htmlmixedmode.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions