1 `swank:completions` <- function(slimeConnection, sldbState, prefix, package) {
2 bits <- strsplit(prefix, "(?=[A-Z._])", perl=TRUE)[[1]];
3 lrx <- literal2rx(bits)
4 ## FIXME: this includes slightly too much .*, because the strsplit
5 ## seems to split before /and/ after the match.
6 rx <- paste(lrx, collapse=".*")
7 matches <- apropos(sprintf("^%s", rx), ignore.case=FALSE)
8 nmatches <- length(matches)
9 if((nmatches == 0) && ((dollar <- regexpr("$", prefix, fixed=TRUE)) > -1)) {
11 symbolFieldsCompletion(globalenv(), prefix, prefix)
13 returnMatches(matches)