r-lib / rprojroot

Finding files in project subdirectories
https://rprojroot.r-lib.org/
Other
149 stars 23 forks source link

tabcompletion #45

Closed hansvancalster closed 3 years ago

hansvancalster commented 4 years ago

Not sure if this request is possible, neither if this is the right place to ask....

I use the rprojroot package a lot and it is a real lifesaver. The only downside I experience is that RStudio's tabcompletion for files and folders is relative to the current working directory. It would be great if tabcompletion would recognize the location relative to the root criterion given in for instance find_root_file(...., criterion = ...).

So for instance if I type find_root_file(", criterion = is_git_root) and locate my cursor after the " and press TAB, I would like to see the folders and files appear relative to the location of the git root.

krlmlr commented 3 years ago

Thanks. A workaround could be to open a second RStudio instance where your Git root is, and do the path completion there. Not exactly elegant.

Passing this on to @kevinushey: Can the RStudio IDE support such complex autocompletion rules?

kevinushey commented 3 years ago

We could in theory. We've thought in the past about making it possible for packages to provide their own custom auto-completion routines for RStudio, but just haven't made it happen yet.

krlmlr commented 3 years ago

Thanks. Closing for now, we may revisit when a hook becomes available.

hansvancalster commented 3 years ago

Thanks for considering! And at least I see a sparkle of hope for making this possible in the future.

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.