Displaying 2 results from an estimated 2 matches for "specialcompletions".
2009 Sep 11
1
Modify functions in base packages (needed for completion for proto objects)
...letion for proto objects. Proto extends
environment in a hierarchical way. Thus completion should list all the
names in all it's parent environments.
For "normal" classes defining names.class would do the job, but completion
for "environment" is hard coded in utils:::specialCompletions by means of
base::ls(). As result defining names.proto does not work.
I tried to make "ls" generic and to do something like:
environment(ls.default) <- asNamespace('utils')
environment(ls) <- asNamespace('utils')
environment(ls.proto) <- asNamespace('utils...
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
...ider:
x <- list(`a b` = 1)
x$a<tab>
(i.e., press the 'tab' key after typing 'x$a')
The auto-complete mechanism will fill the buffer like so:
x$a b
This is not particularly helpful because this is now a syntax error.
It seems to me there's a simple fix -- in
utils:::specialCompletions(), we can wrap the result of
utils:::specialOpCompletionsHelper() with backticks for non-syntactic
names ([1]):
comps <- specialOpCompletionsHelper(op, suffix, prefix)
if (length(comps) == 0L) comps <- ""
+non_syntactic <- make.names(comps) != comps
+comps[non_syntactic] <- p...