getSourceEditorContext() does not work correctly with visual markdown editing when called from addin
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the addin calls to getActiveDocumentContext and getSourceEditorContext with the cursor in R Markdown text and code chunks during visual editing. Compare those results with source editing mode and the R console; done when the relevant context, including the currently shown Rmd path, is returned consistently outside code chunks.
Written by the indexing model from the issue text.
Description
The visual markdown editing feature of the RStudio preview version really looks great! When testing it I found out, however, that getActiveDocumentContext and getSourceEditorContext don't work correctly.
I have an RStudio Addin in my RTutor package that calls getSourceEditorContext in order to get the path of the currently shown Rmd file. In source editing mode that works fine. In the visual markdown editing that only works if the cursor is in a code chunk, if the cursor is on some Rmd text then getSourceEditorContext returns NULL.
Note that if the cursor is in the R console getSourceEditorContext() also works well, even when called from the addin. The problem thus only arises if the cursor is in some none-chunk line in the Rmd file.
The bug ocurred with both the CRAN and Github version of rstudioapi.
- Dominant language
- R
- Stars
- 175
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/rstudioapi
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rstudio/rstudioapi#313 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
rstudio/rstudioapi#321 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
rstudio/rstudioapi#318 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rstudio/rstudioapi#315 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
rstudio/rstudioapi#314 ·
All issues in rstudio/rstudioapi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·