sourcegraph / lsif-go

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

gomod: special case listing the stdlib #260

Closed keegancsmith closed 2 years ago

keegancsmith commented 2 years ago

Before this commit lsif-go fails on the standard library for go. When running the "go list all" command fails to run with an error message like:

cannot find package "." in:
  path/to/a/vendor/dir
...

This might be an issue in upstream go list. However, you normally do need special handling of the go stdlib tool. In our case we can just skip listing dependencies since it is the standard library.

Test Plan: We eyeballed the lsif dump after running on stdlib, and it looked legitimate. However, we don't know much about lsif.

Co-authored-by: @stefanhengl

efritz commented 2 years ago

@keegancsmith we're actively writing scip-go at this point. @tjdevries are bug fixes worth accepting in this repo?

tjdevries commented 2 years ago

Also, I'm trying to re-use as much of the original stuff we have (detecting stdlib, package, etc.), so improvements to this part of the code are useful. I'll take a look right now

keegancsmith commented 2 years ago

Changes seem fine -- I'm not sure exactly how you were running it, but if it's working for you I think we can merge.

Just running lsif-go in the golang/go src dir. If you see our auto indexing jobs on sg.com they are failing for the src dir.