-
Notifications
You must be signed in to change notification settings - Fork 139
Description
Positron Version:
Positron-2024.06.1-27
Steps to reproduce the issue:
My favorite part of VSCode and R is the code cell feature, so I'm very excited to see support in Positron. There's a few features missing, so I wanted to flag them here. I'm happy to submit a pull request if outside contributions are welcomed? I've contributed to the R VSCode on this feature, so am aware of VSCode extension development (REditorSupport/vscode-R#1454)
- Create a new R file and a new python file and insert this code:
#+
2 + 1
3 + 2
#+
1 + 1
2 + 2
#+
2 + 2
#' # Hi
#'
#' Testing `knitr::spin` markdown syntax
#' # %%
2 + 1
3 + 2
# %%
1 + 1
2 + 2
# %%
2 + 2
# %% [markdown]
# Hi
Testing `knitr::spin` markdown syntaxWhat did you expect to happen?
Here are the bugs I'm seeing
-
Note the cells only can be one contiguous blob of code (no new lines). That is from
isCellEnd: (line) => line.trim() === '',. I think the tests for this have no extra new lines, so this is not noticed.
positron/extensions/positron-code-cells/src/parser.ts
Lines 83 to 90 in c929d52
const rCellParser: CellParser = { isCellStart: (line) => line.startsWith('#+'), isCellEnd: (line) => line.trim() === '', getCellType: (_line) => CellType.Code, getCellText: getCellText, newCell: () => '\n\n#+', cellDecorationSetting: () => CellDecorationSetting.All, }; -
Cold folding does not seem to work (it does in python). I'm not sure how this test is passing. When I copy the text to mine, it does not offer folding.
positron/extensions/positron-code-cells/src/test/folding.test.ts
Lines 37 to 42 in c929d52
const content = `#+ testing1 #+ testing2 #+ testing3`; -
Pyright is creating errors for a markdown cell.
-
knitr has markdown support via the
#'syntax, but is not being recognized -
Also,
# %%is supported by VSCode,knitr::spin(), and quarto. Would love to add that option for R: https://www.rdocumentation.org/packages/knitr/versions/1.46/topics/spin
Were there any error messages in the output or Developer Tools console?
There were not any error messages.
