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.
I was thinking that this function would take a map that included both the names and the values.