sourcegraph / lsif-go

Language Server Indexing Format (LSIF) generator for Go
https://lsif.dev/
MIT License
116 stars 20 forks source link

inferring module name fails when module name isn't the VCS name #264

Open justinrush opened 1 year ago

justinrush commented 1 year ago

We have a go mod redirect service that sits in front of our various VCS repos so we can have our go mods all belong to the same module parent and the location in the VCS group structure doesn't dictate the location in our go mod tree. For example go.our-company.com/core/http refers to a location in Gitlab's group structure like gitlab.ourcompany.com/services/core/lib/http-go.

This causes the vcs.RepoRootForImportPath method to return an error because it attempts to use the VCS name, which isn't resolvable. Would you be open to a PR that uses the module name as specified in the go.mod file if a flag (e.g. --use-go-mod-name) is specified?