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 for $ autocompletion in nested lists #1389

Open
Ben-Drucker opened this issue Jun 30, 2023 · 2 comments
Open

Support for $ autocompletion in nested lists #1389

Ben-Drucker opened this issue Jun 30, 2023 · 2 comments

Comments

@Ben-Drucker
Copy link

Is your feature request related to a problem? Please describe.
Sometimes, I'm using nested lists, for example

l <- list(a1 = list(b = 3, c = list(1, 2, d = list(e = 3))), a2 = 4, a3 = 5)

The existing autocompletion feature when using the $ selector is very handy to bring up the possible elements:
image
However, if one tries to use the $ operator on a sublist, no autocompletions are available:
image
If I'm manipulating a nested list from, say, an external package, I don't always know what the elements of a nested list are (and they're not always documented). So it would be nice to see them directly within the code editor.

Perhaps this is because autocompletions only appear when an object is evaluated. Hence, a potential workaround is assigning l$a1 to an intermediate variable and using $ on that.

Describe the solution you'd like
When selecting elements of a nested list using multiple $, the elements of the nested list should appear as auto-suggestions.

Describe alternatives you've considered
One can assign an intermediate, temporary variable and then use the $ selector on that. Obviously, one could also print the list of elements in the terminal, but the presentation is much nicer when it's integrated into the code editor.

Additional context
I've really enjoyed using this extension! It's incredibly useful :)

@renkun-ken
Copy link
Member

If you enable r.useWebServer which starts a http web server via {httpuv} and communicates with vscode-R session watcher, using $ on a nested list should work.

Copy link

This issue is stale because it has been open for 365 days with no activity.

@github-actions github-actions bot added the stale label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants