-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R code cell parser issues #3709
Comments
Thanks for the feedback!
This is #2924; we've temporarily disabled the code cell folder (which indeed used to work) until we can integrate it with the other language folding rule providers. |
Thanks Kyle! Aside from the issue Jonathan mentioned, the rest of your points do indeed look like bugs. Outside contributions are welcomed, please feel free to tag me in any PRs. |
Hi @seeM, I'm working on a PR and wanted to add more test coverage. I'm trying to figure out how to run the tests with mocha. What is the correct way to do that? Compile to |
I usually:
Steps 1 and 2 are both needed since these tests actually run against a build of Positron. The VSCode contributing docs may also be helpful: https://github.com/microsoft/vscode/wiki/How-to-Contribute. |
- R parser would end cells after first blank line; this is now removed - `# %%` is now recognized as a valid cell demarcation in R - cellDecorationSetting now matches python (only highlights currently active cell - Tests added to test for these changes
Addresses #3709. Changes: - R parser would end cells after first blank line; this is now removed - `# %%` is now recognized as a valid cell demarcation in R - cellDecorationSetting now matches python (only highlights currently active cell). Note that before the whole program is highlighted a gray color, so the information was meaningless. - Tests added to test for these changes --------- Signed-off-by: Kyle F Butts <buttskyle96@gmail.com> Co-authored-by: Wasim Lorgat <mwlorgat@gmail.com>
Verified FixedPositron Version(s) : 2024.07.0-67 Test scenario(s)Provided examples work as expected Link(s) to TestRail test cases run or created:Tests were included as part of PR |
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)
What did you expect to happen?
This is the resulting view:
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
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
Pyright is creating errors for a markdown cell.
knitr has markdown support via the
#'
syntax, but is not being recognizedAlso,
# %%
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/spinWere there any error messages in the output or Developer Tools console?
There were not any error messages.
The text was updated successfully, but these errors were encountered: