gopls/doc: update stale documentation and improve link names
Following up on comments from CL 428595 and CL 426796, improve links to
'here', and update a stale comment on gopls' code location.
Updates golang/go#54509
Change-Id: Ie0e04b01b6e7193294fb9c39a809cee1a5b981c5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/429215
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
diff --git a/gopls/doc/contributing.md b/gopls/doc/contributing.md
index 110aa1b..367280f 100644
--- a/gopls/doc/contributing.md
+++ b/gopls/doc/contributing.md
@@ -18,8 +18,8 @@
## Getting started
-Most of the `gopls` logic is actually in the `golang.org/x/tools/gopls/internal/lsp`
-directory, so you are most likely to develop in the golang.org/x/tools module.
+Most of the `gopls` logic is in the `golang.org/x/tools/gopls/internal/lsp`
+directory.
## Build
diff --git a/gopls/doc/settings.md b/gopls/doc/settings.md
index 0412468..58e9750 100644
--- a/gopls/doc/settings.md
+++ b/gopls/doc/settings.md
@@ -286,8 +286,8 @@
analyses specify analyses that the user would like to enable or disable.
A map of the names of analysis passes that should be enabled/disabled.
-A full list of analyzers that gopls uses can be found
-[here](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).
+A full list of analyzers that gopls uses can be found in
+[analyzers.md](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).
Example Usage:
@@ -307,7 +307,8 @@
**This setting is experimental and may be deleted.**
staticcheck enables additional analyses from staticcheck.io.
-These analyses are documented at [here](https://staticcheck.io/docs/checks/).
+These analyses are documented on
+[Staticcheck's website](https://staticcheck.io/docs/checks/).
Default: `false`.
@@ -401,9 +402,9 @@
**This setting is experimental and may be deleted.**
-hints specify inlay hints that users want to see.
-A full list of hints that gopls uses can be found
-[here](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).
+hints specify inlay hints that users want to see. A full list of hints
+that gopls uses can be found in
+[inlayHints.md](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).
Default: `{}`.
diff --git a/gopls/internal/lsp/source/api_json.go b/gopls/internal/lsp/source/api_json.go
index 94e6b1d..56f7c0f 100755
--- a/gopls/internal/lsp/source/api_json.go
+++ b/gopls/internal/lsp/source/api_json.go
@@ -214,7 +214,7 @@
{
Name: "analyses",
Type: "map[string]bool",
- Doc: "analyses specify analyses that the user would like to enable or disable.\nA map of the names of analysis passes that should be enabled/disabled.\nA full list of analyzers that gopls uses can be found\n[here](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).\n\nExample Usage:\n\n```json5\n...\n\"analyses\": {\n \"unreachable\": false, // Disable the unreachable analyzer.\n \"unusedparams\": true // Enable the unusedparams analyzer.\n}\n...\n```\n",
+ Doc: "analyses specify analyses that the user would like to enable or disable.\nA map of the names of analysis passes that should be enabled/disabled.\nA full list of analyzers that gopls uses can be found in\n[analyzers.md](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).\n\nExample Usage:\n\n```json5\n...\n\"analyses\": {\n \"unreachable\": false, // Disable the unreachable analyzer.\n \"unusedparams\": true // Enable the unusedparams analyzer.\n}\n...\n```\n",
EnumKeys: EnumKeys{
ValueType: "bool",
Keys: []EnumKey{
@@ -461,7 +461,7 @@
{
Name: "staticcheck",
Type: "bool",
- Doc: "staticcheck enables additional analyses from staticcheck.io.\nThese analyses are documented at [here](https://staticcheck.io/docs/checks/).\n",
+ Doc: "staticcheck enables additional analyses from staticcheck.io.\nThese analyses are documented on\n[Staticcheck's website](https://staticcheck.io/docs/checks/).\n",
Default: "false",
Status: "experimental",
Hierarchy: "ui.diagnostic",
@@ -518,7 +518,7 @@
{
Name: "hints",
Type: "map[string]bool",
- Doc: "hints specify inlay hints that users want to see.\nA full list of hints that gopls uses can be found\n[here](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).\n",
+ Doc: "hints specify inlay hints that users want to see. A full list of hints\nthat gopls uses can be found in\n[inlayHints.md](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).\n",
EnumKeys: EnumKeys{Keys: []EnumKey{
{
Name: "\"assignVariableTypes\"",
diff --git a/gopls/internal/lsp/source/options.go b/gopls/internal/lsp/source/options.go
index c904340..fdcb98c 100644
--- a/gopls/internal/lsp/source/options.go
+++ b/gopls/internal/lsp/source/options.go
@@ -65,9 +65,9 @@
"golang.org/x/tools/gopls/internal/lsp/analysis/unusedvariable"
"golang.org/x/tools/gopls/internal/lsp/analysis/useany"
"golang.org/x/tools/gopls/internal/lsp/command"
+ "golang.org/x/tools/gopls/internal/lsp/protocol"
"golang.org/x/tools/internal/diff"
"golang.org/x/tools/internal/diff/myers"
- "golang.org/x/tools/gopls/internal/lsp/protocol"
)
var (
@@ -386,8 +386,8 @@
type DiagnosticOptions struct {
// Analyses specify analyses that the user would like to enable or disable.
// A map of the names of analysis passes that should be enabled/disabled.
- // A full list of analyzers that gopls uses can be found
- // [here](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).
+ // A full list of analyzers that gopls uses can be found in
+ // [analyzers.md](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).
//
// Example Usage:
//
@@ -402,7 +402,8 @@
Analyses map[string]bool
// Staticcheck enables additional analyses from staticcheck.io.
- // These analyses are documented at [here](https://staticcheck.io/docs/checks/).
+ // These analyses are documented on
+ // [Staticcheck's website](https://staticcheck.io/docs/checks/).
Staticcheck bool `status:"experimental"`
// Annotations specifies the various kinds of optimization diagnostics
@@ -428,9 +429,9 @@
}
type InlayHintOptions struct {
- // Hints specify inlay hints that users want to see.
- // A full list of hints that gopls uses can be found
- // [here](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).
+ // Hints specify inlay hints that users want to see. A full list of hints
+ // that gopls uses can be found in
+ // [inlayHints.md](https://github.com/golang/tools/blob/master/gopls/doc/inlayHints.md).
Hints map[string]bool `status:"experimental"`
}