Граф коммитов

8 Коммитов

Автор SHA1 Сообщение Дата
Alan Donovan f6a239054f gopls/doc: delete commands.md
This change deletes the public documentation of gopls'
command set, which is an internal implementation detail.
Adventurous users can read the source of command.Interface.

Also, delete the Commands portion of the JSON API,
which is not used.

Change-Id: Ib2e2e8fcee880805c6556ee40fcbe1891712af5a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/597276
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-08-01 00:23:54 +00:00
Alan Donovan 799a47185d gopls/doc: document all of gopls' features
This CL enumerates and documents each LSP feature
supported by gopls so that users can find out:
- what the tool is capable of,
- how to use it,
- what settings affect the feature, and
- whether their LSP client supports a given feature.

We plan to provide Code Actions to open the relevant
section of the manual, e.g. "Refactor > Describe refactorings..."

To review the markdown, cherrypick this CL then
run this command from x/tools:

 $ go run rsc.io/cmd/mdweb@latest -a localhost:9876 &
   open http://localhost:9876/gopls/doc/features/README.md

The topic of completion is left for another day,
as is support for go.mod files.

Updates golang/go#54115

Change-Id: I8f7de7571bfe0355b3597487efbc0d7aae7a12d6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/583316
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-06-28 16:11:53 +00:00
Alan Donovan f06ed92a26 gopls/internal/settings: define InlayHints enum
This allows us to simplify both the declaration of the enum
(particularly its doc comments) and the generator logic,
which no longer treats it as a special case.

Now that "analyses" is the only remaining special case
of map[string]bool, consolidate the two generator
hacks for it.

Change-Id: I49d4e3ca41e96d02d8444925cc013e2b19cf2305
Reviewed-on: https://go-review.googlesource.com/c/tools/+/593616
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-06-24 14:56:03 +00:00
Alan Donovan 2d104ec5d2 gopls/doc/generate: treat LinksInHover as an enum
This CL defines a type for the true|false|"gopls" type used
by linksInHover, and adds a special case to the doc+api generator
to treat it as an enum, so that VS Code will present a better
value-chooser UI for it.

Also, document the type grammar used in the docs.

Updates golang/go#68057

Change-Id: I9e334fbc94dcbdc70657d8e64f67fb807e69cbf8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/593656
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-06-20 18:03:41 +00:00
Alan Donovan fc82f4e5a0 gopls/internal/protocol/command: use gopls.foo form everywhere
Before, the command.Command enum values (e.g. "run_tests") did
not match the actual command strings used in the Command field
of protocol.Command (e.g. "gopls.run_tests").

This change causes us to use the "gopls."-prefixed form everywhere,
avoiding the need for various conversions, and the opportunity
to forget to make them.

Also
- tidy up the commands.md markdown.
- remove 2x TODOs about eliminating Command.Title:
  I think it works nicely in the documentation.
- remove ⬤ blobs from markdown by popular demand.

Change-Id: Ida5981ba834ea148fa0267319cf874b9a48c9289
Reviewed-on: https://go-review.googlesource.com/c/tools/+/591175
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-06-07 14:44:27 +00:00
Alan Donovan c3aae998cf gopls/doc: tidy up analyzer documentation
Details:
- add introduction.
- change generator to put title in H2 heading,
  and add anchors.
- organize list of analyzers in gopls settings.
- fix typos.

Change-Id: Ie559a331a2ac51171c366104416d53a8329afe7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/586779
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
2024-05-20 21:14:40 +00:00
Alan Donovan 0b4dca13e9 gopls/internal/protocol: separate CodeLens from Command; document
Historically, CodeLenses were identified in the UI (LSP, CLI, docs)
by the command.Command that they return, but this is confusing
and potentially ambiguous as a single lens algorithm may offer
many commands, potentially overlapping.

This change establishes a separate CodeLensKind identifier for
them. The actual string values must remain unchanged to avoid
breaking users.

The documentation generator now uses the doc comments attached
to these CodeLensKind enum declarations. I have updated and
elaborated the documentation for each one.

Change-Id: I4a331930ca6a22b85150615e87ee79a66434ebe3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/586175
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-17 21:14:34 +00:00
Alan Donovan e149e84fbc gopls: rationalize code generation
- Replace the settings.APIJSON global variable (a JSON-encodable
  data structure) with a JSON string in gopls/internal/doc.JSON,
  of type doc.API. The JSON types are no longer part of gopls itself,
  only of the build-time generator.
- Publish the JSON types that describe the output of
  'gopls api-json' as doc.API etc, and document this.
- Change 'gopls api-json' to simply print doc.JSON, instead of
  JSON-encoding a large data structure that is otherwise unused.
  This eliminates the dependency on github.com/jba/printsrc.
- Document the various inputs and outputs of the build scripts.
- Delete api-diff. Diffing the api.json file is a simple git command.

Change-Id: Ibfbff4d9e9845ef1c4b8c07b483459688d95d243
Reviewed-on: https://go-review.googlesource.com/c/tools/+/583977
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2024-05-08 16:57:03 +00:00