Open realh opened 7 years ago
A PR would be great! I'm not currently using Fakegir because I can't manage to get it working with vim but that's a feature I would welcome!
OK, I've made the PR.
It certainly isn't straightforward getting this working in vim. I think I've managed it with youcompleteme, although I haven't tested it properly yet. I could write a wiki page about it if you like, but it would be good if I could have a better understanding of it first.
AFAICT fakegir.py creates a list of classes etc appearing at the top-level of each module but doesn't add the class members. Then build-jedi-cache.sh uses sith.py to add the members to the cache. Is that right?
I guess this issue can be closed now because the PR is merged.
I ran into a related problem: on OS X the prefix is /usr/local instead of /usr. Perhaps a better long-term solution would be to read it with pkg-config --variable=girdir gobject-introspection-1.0
and deal with special cases like GEdit by allowing a full path to be specified on the command line.
It's not quite as simple as I thought when I posted the previous comment, because with homebrew all gobject-introspection's pkg-config variables are based on a prefix of /usr/local/Cellar/gobject-introspection/${version}/
and the girdir within that only contains files supplied with that package. The directory that contains all the other gir files (eg from gtk+3) is /usr/local/share/gir-1.0
and there doesn't seem to be a definitive way to detect that. As a workaround in a separate gir parser I'm writing, I use pkg-config as above, but just test whether it starts with /usr/local/
and if so use /usr/local/share/gir-1.0
, otherwise use whatever pkg-config returned, which works for Linux (returning /usr/local/gir-1.0
).
As well as the main libraries in
/usr/share/gir-1.0
, a number of packages install gir files in other directories, for example GEdit. They all seem to use the pattern/usr/share/*/gir-1.0
, where is the package name, so it should be quite easy to scan for them, although I don't know what extra steps might be needed in case fakegir needs to use the corresponding typelib files in `/usr/lib/x86_64-linux-gnu//girepository-1.0/`.Should I try to make a simple implementation and raise a PR?