ben-gibson / GitLink

A Jetbrains plugin that opens a local file under Git version control in its remote host using the default browser.
https://plugins.jetbrains.com/plugin/8183-gitlink
MIT License
671 stars 58 forks source link

Open Go module documentation link #292

Open ash2k opened 1 year ago

ash2k commented 1 year ago

Hi! Feature request. When browsing sources of a Go module in GoLand, it'd be very useful to have a context menu item to open docs for that module.

Example.

Say I'm browsing ~/go/pkg/mod/github.com/redis/go-redis/extra/redisprometheus/v9@v9.0.2/collector.go. Docs for that package is at https://pkg.go.dev/github.com/redis/go-redis/extra/redisprometheus/v9.

Or ~/go/pkg/mod/github.com/prometheus/prometheus@v0.40.5/model/labels/labels.go. Docs are at https://pkg.go.dev/github.com/prometheus/prometheus@v0.40.5/model/labels.

The ~/go/pkg/mod path can be retrieved by running go env GOMODCACHE command:

go env GOMODCACHE
/Users/mike/go/pkg/mod

It probably depends on the Go SDK selected for the project (there may be multiple installed on the system). There may be a way to get it somehow via the IDE API, I have no idea.

p.s. Thanks for a very useful plugin!