Use source index to get completions from current package

NOTE: This could use some review as I'm not fully aware of the most 'idiomatic' ways of generating R objects / lists from C++ code.

This PR generates autocompletions from the source index when working on a package project.
Yes, it checks whether it's in the R/ subdirectory. 

I don't think the same treatment applies to inst/ or tests/ though, as that code does not run inside the package environment (and therefore requires a library call which we'd presumably pick up). I guess for tests/ the way they are typically segmented the library call might come in e.g. the test_all wrapper script so we could have an implicit "library" call for the current package when doing completions within tests/