R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
128 stars 15 forks source link

Can't send code from R documentation to R Console #143

Open jalvesaq opened 1 month ago

jalvesaq commented 1 month ago

How to replicate the bug:

  1. Start R: <LocalLeader>rf
  2. Put the cursor over a word, e.g. rnorm, and press <LocalLeader>rh.
  3. Go to the Examples section: <LocalLeader>ge
  4. Try to send any code to R.

The error is:

[...] There is no parser available for buffer [...]

Maybe we have to create a parser for rdoc: https://tree-sitter.github.io/tree-sitter/creating-parsers

Workaround: instead of <LocalLeader>rh, press <LocalLeader>re to open the Examples section in a temporary R file.

PMassicotte commented 1 month ago

I usually do what you suggest as work around. Also, once the help file is open, I can do :set filetype=r and send code directly from the examples section.