REditorSupport / REditorSupport/languageserver
[FR] support language services for functions inside of an environment
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 675
- Forks
- 118
- Avg merge
- 1d 37m
- Merged PRs (30d)
- 11
Description
I often use "environment" as the namespace of R, so that I can manage the name conflicts in a large R project. Also, it's much easier to find the source of the function, with such "namespace".
However, using this pattern in VSCode R is not very convenient, as it can't provide any parameter info when calling functions inside of an environment (or a list).
It's probably difficult to provide "static" analysis for environment functions. But I think, at least we should use the current session info, as RStudio IDE does.
Thanks.
normal_fun <- function(a, b) {
a + b
}
env <- new.env()
env$fun <- function(a, b) {
a + b
}
# move curser on normal_fun, vscode tips the arguments; type a inside the bracket, it hints `a` is an argument
normal_fun()
# in contrast, a function inside an environment loses such ability
env$fun()
Contributor guide
No contributing guide indexed for this repository
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 language-server entry point that provides parameter information, using the issue's normal_fun and env$fun examples as the comparison case. Determine how current-session information could identify functions stored in environments or lists, and consider the work complete when calls such as env$fun() receive the same parameter hints as normal_fun().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100