-
Notifications
You must be signed in to change notification settings - Fork 92
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
R: Completions: Adding parentheses inside of debug()
and undebug()
#2338
Comments
I think @lionel- wants to eventually tackle this in a generic way with his That's a while away though |
In the meantime, RStudio does have a set of base functions where it doesn't add |
This heuristic based on the formals is also interesting (i.e. is the argument name |
I have thought about opening an issue about this as well. |
I also wish the automatic parentheses were not added when completing a function name after Screen.Recording.2024-05-10.at.3.09.56.PM.mov |
debug()
and undebug()
debug()
and undebug()
Update: I now know the issue of adding parentheses after |
I know this isn't exactly the right issue, but it's related. Can we just turn off parenthesis after autocompletion altogether? I have turned off this feature in RStudio for years and never want the parentheses added. It seems like other VS Code language extensions have options to turn off that feature and I would prefer to disable it here too. Heck, I'd even turn off matching closing parentheses/quotes/brackets too. I know not everyone likes that, but it would be nice to have the option. |
@jaredlander I think that makes sense, I've opened an issue at #5377 To disable delimiter auto-closing while typing you can set: "editor.autoClosingBrackets": "never" |
I figured out the auto closing thing shortly after posting and even how to do it just for R. Thanks for opening #5377. |
QA NotesIn the R Console:
# GOOD, what you should see
args(new.env)
#> function (hash = TRUE, parent = parent.frame(), size = 29L)
#> NULL
# BAD, what you should NOT see
args(new.env())
#> NULL
Created on 2025-02-10 with reprex v2.1.1 |
For: * posit-dev/ark#680 ### Release Notes #### New Features - R completions in specific contexts (such as with the `?` help operator or inside `debug()`) no longer add trailing parentheses to functions (#1818, #2338). #### Bug Fixes - N/A ### QA Notes In the R Console: * Request help for a function, such `enc2native()`, using the `?` operator. Literally, type `?enc2` and allow the completions to pop-up. Accept the completion for `enc2native`. There should be no trailing parentheses. You should complete to `?enc2native` and not `?enc2native()`. * Apply the `str()` or `args()` function to a function, while accepting a completion for that function. Let's use the `new.env()` function as an example. Start typing `args(new.)` and allow the completions to pop-up. Accept the completion for `new.env`. There should be no trailing parenthese. You should complete to `args(new.env)`, which works and reveals the arguments, not to `args(new.env())`, which just returns `NULL`. ``` r # GOOD, what you should see args(new.env) #> function (hash = TRUE, parent = parent.frame(), size = 29L) #> NULL # BAD, what you should NOT see args(new.env()) #> NULL ``` <sup>Created on 2025-02-10 with [reprex v2.1.1](https://reprex.tidyverse.org)</sup>
Verified Fixed
Test scenario(s) |
In usability testing with @simonpcouch today, we noticed that using autocomplete inside of
debug()
orundebug()
gets you parentheses that keep it from working. For example, you want:but what you get with autocomplete is:
which then errors during debugging.
We've done related work in #1563 but we do know we are inside of
debug()
/undebug()
in this situation and could maybe not add the parentheses?The text was updated successfully, but these errors were encountered: