-
Notifications
You must be signed in to change notification settings - Fork 129
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
add a way to declare a cell and a command run cell #191
Comments
Hi @StevenLi-DS, thank you for the suggestion. Using Ctrl-Enter sends multiple lines of code if they’re linked together by brackets or pipes etc. but being able to declare cells would enable more control over what constitutes a sendable block of code. I’ll put this as ‘help wanted’. |
I would suggest implementing this in a way that makes it compatible with rstudio sections: https://support.rstudio.com/hc/en-us/articles/200484568-Code-Folding-and-Sections This would also make it possible to add a code navigation feature from rstudio that generates a "table of contents" via the code sections. |
Code section is already implemented in languageserver by REditorSupport/languageserver#163 and folding by REditorSupport/languageserver#294. |
Regarding the original request here, cell-based approach is more supported by the Notebook API to have code cells suggested at #378 and being implemented at #394. It is also possible to support in-document cells similar with vscode-python's. It looks like we might need to take a look at the APIs of editor decoration and code actions. |
@renkun-ken Oh that's cool! Sorry for my superflous comment, vsc-r/lsp can do so much I am still learning everyday. Thank you for your work on these projects. |
With rmarkdown code chunks support implemented, this code chunk in R script should be straightforward. |
If this is something people are still interested in, I have this working by piggybacking on rmarkdown.ts like @renkun-ken suggested: Still needs a little polishing, but is functioning as expected |
@ElianHugh Thanks for working on this. I believe it is still quite useful. It would be nice for you to put it into a PR anytime you like. |
Please considering add a way to declare a cell like
#%%
so that users can run code from cell to cell without selecting multiple lines of code.example:
https://code.visualstudio.com/docs/python/jupyter-support-py#_jupyter-code-cells
https://nteract.gitbooks.io/hydrogen/
The text was updated successfully, but these errors were encountered: