Skip to content
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

Support variables pane for R (was: Code highlight for R kernel) #5264

Closed
phisanti opened this issue Mar 24, 2021 · 6 comments
Closed

Support variables pane for R (was: Code highlight for R kernel) #5264

phisanti opened this issue Mar 24, 2021 · 6 comments
Labels
feature-request Request for new features or functionality language-any Area covering general issues geared to supporting any language (not just Python) variable-explorer

Comments

@phisanti
Copy link

So I am currently using the latest version of Jupyter (v2021.2.0) on my laptop. I find it very cool that I can also use R kernels, even with IntelliSense! yet I might be missing something because I would like to see the variables that I have created and if possible code highlight. Here is a screenshot.
image

@rchiodo
Copy link
Contributor

rchiodo commented Mar 24, 2021

Thanks for the suggestion.

We'd likely need help from the R community to get code highlighting and the variable explorer to work.

The variable explorer uses a setting to determine how to query the R kernel for the value of a variable. Specifically this one:

"jupyter.variableQueries": 
                        [
                            {
                                "language": "python",
                                "query": "_rwho_ls = %who_ls\\nprint(_rwho_ls)",
                                "parseExpr": "'(\\w+)'"
                            },
                            {
                                "language": "julia",
                                "query": "whos",
                                "parseExpr": "'(\\w+)'"
                            }
                        ]

If you added a setting for R, you might be able to figure out how get the kernel to return variable information. On top of that the R kernel has to support the jupyter 'introspection' message.

Syntax highlighting is more about VS code supporting R as a default language. In the VS code insiders build, I believe R highlighting should already work.

@greazer greazer changed the title Code highlight for R kernel Support variables pane for R (was: Code highlight for R kernel) Mar 25, 2021
@greazer
Copy link
Member

greazer commented Mar 25, 2021

Thanks for your feedback. The code colorization issue will be addressed once VS Code adds native support for editing notebooks. Please see microsoft/vscode#91987. You can experiment by using VS Code insiders, which defaults to the new notebook experience.

We're keeping this open to track the ability for R to display variables.

@morning-start
Copy link

R kernel supports the jupyter 'introspection' message. #710

But what I set could use the variableQueries.

    {
      "language": "R",
      "query": "as.list(.GlobalEnv)",
      "parseExpr": "'(\\w+)'"
    }
    {
      "language": "R",
      "query": "_rwho_ls = %who_ls\\nprint(_rwho_ls)",
      "parseExpr": "'(\\w+)'"
    }

all of these can't work

@rchiodo
Copy link
Contributor

rchiodo commented Mar 23, 2022

There's likely something that causes a parsing error. You'd have to debug our variable code to figure out why.

@greazer
Copy link
Member

greazer commented Apr 18, 2022

Iteration-candidate because it was on Discussions.

@DonJayamanne
Copy link
Contributor

Its been a while and there haven't been enough upvotes on this issue,
Hence closing this, if still required please feel free to ping here and we'll re-open this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality language-any Area covering general issues geared to supporting any language (not just Python) variable-explorer
Projects
None yet
Development

No branches or pull requests

6 participants