vsch / idea-multimarkdown

Markdown language support for IntelliJ IDEA.
https://plugins.jetbrains.com/plugin/7896-markdown-navigator
Apache License 2.0
813 stars 129 forks source link

Register r markdown codechunk prefix #456

Closed holgerbrandl closed 7 years ago

holgerbrandl commented 7 years ago

Would it be possible to auto-inject r also if code chunks start with ```{r ?

This is because in the Rmarkdown format (which is the most popular literal programming mechanism for R) code chunks start like that. See here for examples.

vsch commented 7 years ago

@holgerbrandl, I will add a configuration option to allow user defined fenced code info string to IDE language mapping. In this case a regex of ^\{r(?:\w|\}) to r will accomplish this.

I had this in mind since the beginning but never got around to implementing it. Currently there are a couple of hardcoded maps which I will move to default map definition.

vsch commented 7 years ago

@holgerbrandl, I hardcoded the r code chuck logic for now. Will take anything that equals or starts with {r that is not followed by an identifier character.

The UI implementation would take longer than I wanted to spend and this was causing the delay in implementation.

EAP released.

holgerbrandl commented 7 years ago

thanks a ton. Works great.

jsinkers commented 4 years ago

Hey - could you please clarify: do I need to define a language injection for rmarkdown or is it meant to work once the R language support plugin is installed?

Currently have associated .rmd with Markdown, but not seeing any syntax highlighting etc. on the Rmarkdown code chunks.

If I do need to define a language injection - would you be able to share a screenshot of the settings used/attach a file defining it?

holgerbrandl commented 4 years ago

Registering the file Rmd type is the correct first step. You'd also need the r language plugin for highlighting and completion.

No need to define anything custom, nor do you need any special settings.