src-d / gitbase

SQL interface to git repositories, written in Go. https://docs.sourced.tech/gitbase
Apache License 2.0
2.07k stars 123 forks source link

docs: update examples #938

Closed erizocosmico closed 5 years ago

erizocosmico commented 5 years ago

Fixes #936

I removed the import paths example because we can no longer extract the import paths just using XPath. Now imports can have two forms (in Go at least):

The issue is you get something like ["bufio", "github.com", "src-d", "go-mysql-server"] instead of ["bufio", "github.com/src-d/go-mysql-server"] as we did before. The current output is useless for the user, so I thought it would be better to hide that from the docs until we implement something more convenient.

There are helpers to extract import paths from a node. We could implement something in gitbase to use those helpers. Perhaps some special @imports or something like this on uast_extract.