REditorSupport / REditorSupport/vscode-R
Support for `$` autocompletion in nested lists
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 139
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 5
Description
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:
However, if one tries to use the $ operator on a sublist, no autocompletions are available:
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 :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing $ autocompletion behavior in the VS Code extension and how it evaluates R objects. Reproduce the nested-list example from the issue, then verify that chained selectors such as l$a1$ show the nested elements without breaking existing suggestions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100