Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions internal/cache/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import (
"strconv"
"strings"

"github.com/gnoverse/gnopls/internal/packages"
"github.com/gnoverse/gnopls/internal/cache/metadata"
"github.com/gnoverse/gnopls/internal/cache/parsego"
"github.com/gnoverse/gnopls/internal/file"
"github.com/gnoverse/gnopls/internal/packages"
"github.com/gnoverse/gnopls/internal/protocol"
"github.com/gnoverse/gnopls/internal/protocol/command"
"github.com/gnoverse/gnopls/internal/settings"
"github.com/gnoverse/gnopls/internal/util/bug"
"github.com/gnoverse/gnopls/internal/typesinternal"
"github.com/gnoverse/gnopls/internal/util/bug"
)

// goPackagesErrorDiagnostics translates the given go/packages Error into a
Expand Down Expand Up @@ -376,7 +376,14 @@ func typesCodeHref(linkTarget string, code typesinternal.ErrorCode) string {

// BuildLink constructs a URL with the given target, path, and anchor.
func BuildLink(target, path, anchor string) protocol.URI {
link := fmt.Sprintf("https://%s/%s", target, path)
var link string

if strings.HasPrefix(path, "gno.land") {
link = fmt.Sprintf("https://%s", path)
} else {
link = fmt.Sprintf("https://%s/%s", target, path)
}

if anchor == "" {
return link
}
Expand Down
2 changes: 1 addition & 1 deletion internal/settings/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func DefaultOptions(overrides ...func(*Options)) *Options {
InlayHintOptions: InlayHintOptions{},
DocumentationOptions: DocumentationOptions{
HoverKind: FullDocumentation,
LinkTarget: "pkg.go.dev",
LinkTarget: "github.com/gnolang/gno/tree/master/gnovm/stdlibs",
LinksInHover: LinksInHover_LinkTarget,
},
NavigationOptions: NavigationOptions{
Expand Down