From d01bb2ff912c348cc37095f3722bf518cba26078 Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Thu, 28 Jul 2022 13:28:39 -0400 Subject: [PATCH] internal/lsp/source: document the handling of GOPRIVATE for linkTarget Document that modules matching GOPRIVATE will not be linked. Updates golang/vscode-go#2362 Change-Id: I7e2447bb50a2cd0d7d394f8589ccd4498f889048 Reviewed-on: https://go-review.googlesource.com/c/tools/+/419979 Run-TryBot: Robert Findley gopls-CI: kokoro Auto-Submit: Robert Findley TryBot-Result: Gopher Robot Reviewed-by: Hyang-Ah Hana Kim --- gopls/doc/settings.md | 3 +++ internal/lsp/source/api_json.go | 2 +- internal/lsp/source/options.go | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gopls/doc/settings.md b/gopls/doc/settings.md index 6d923b71e3..e04436a34d 100644 --- a/gopls/doc/settings.md +++ b/gopls/doc/settings.md @@ -363,6 +363,9 @@ It might be one of: If company chooses to use its own `godoc.org`, its address can be used as well. +Modules matching the GOPRIVATE environment variable will not have +documentation links in hover. + Default: `"pkg.go.dev"`. ##### **linksInHover** *bool* diff --git a/internal/lsp/source/api_json.go b/internal/lsp/source/api_json.go index 94d0f12b4a..807f496a6b 100755 --- a/internal/lsp/source/api_json.go +++ b/internal/lsp/source/api_json.go @@ -116,7 +116,7 @@ var GeneratedAPIJSON = &APIJSON{ { Name: "linkTarget", Type: "string", - Doc: "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n", + Doc: "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n\nModules matching the GOPRIVATE environment variable will not have\ndocumentation links in hover.\n", Default: "\"pkg.go.dev\"", Hierarchy: "ui.documentation", }, diff --git a/internal/lsp/source/options.go b/internal/lsp/source/options.go index 8fa78ae261..1bb135dd57 100644 --- a/internal/lsp/source/options.go +++ b/internal/lsp/source/options.go @@ -350,6 +350,9 @@ type DocumentationOptions struct { // * `"pkg.go.dev"` // // If company chooses to use its own `godoc.org`, its address can be used as well. + // + // Modules matching the GOPRIVATE environment variable will not have + // documentation links in hover. LinkTarget string // LinksInHover toggles the presence of links to documentation in hover.