-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gopls-release-branch.0.6] all: merge master into gopls-release-branc…
…h.0.6 9b8df07 internal/lsp: enable -mod=readonly in workspace module mode f1f686b internal/lsp: re-enable upgrades for individual dependencies d8a2a07 go/packages: improve go invocation errors 19db92e internal/lsp/cache: remove mod upgrade code 0cef57b internal/lsp/protocol: use a pointer for code action's disabled field db4c57d gopls/internal/regtest: split regtests up into multiple packages f871472 internal/lsp/cache: lock in snapshot.knownFilesInDir c2bea79 internal/lsp/source: make it an error to rename embedded fields 514964b gopls/internal/hooks: improve license file test 68bf78a internal/lsp/cmd: improve help output of gopls subcommands 4922717 go/analysis/passes/fieldalignment: delete doc style comments in fix 917f61d gopls/internal/regtest: automate counting of editor notifications to await 2972602 internal/lsp: correct links provided in critical error pop-ups e13398c internal/lsp: display current diagnostics in the debug server cf1022a gopls: factor out advanced documentation from the README 87bc10f gopls: mention workspaces and build systems in the README ce34e26 internal/lsp: don't show context cancellation in the progress bar bec622c gopls: merge README and user.md 7e51fbd gopls/internal/regtest: re-enable android builder Change-Id: I0e262f49306c7b44d89d994dfa89659fe04b6724
- Loading branch information
Showing
81 changed files
with
1,193 additions
and
1,013 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,8 @@ type NoNameBad struct { | |
x byte | ||
z byte | ||
} | ||
|
||
type WithComments struct { | ||
b [0]byte | ||
a uint32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,99 @@ | ||
# gopls documentation | ||
# `gopls`, the Go language server | ||
|
||
[![PkgGoDev](https://pkg.go.dev/badge/golang.org/x/tools/gopls)](https://pkg.go.dev/golang.org/x/tools/gopls) | ||
|
||
gopls (pronounced: "go please") is the official [language server] for the Go language. | ||
`gopls` (pronounced "Go please") is the official Go [language server] developed | ||
by the Go team. It provides IDE features to any [LSP]-compatible editor. | ||
|
||
## Status | ||
<!--TODO(rstambler): Add gifs here.--> | ||
|
||
It is currently in **alpha**, so it is **not stable**. | ||
You should not need to interact with `gopls` directly--it will be automatically | ||
integrated into your editor. The specific features and settings vary slightly | ||
by editor, so we recommend that you proceed to the [documentation for your | ||
editor](#editors) below. | ||
|
||
You can see more information about the status of gopls and its supported features [here](doc/status.md). | ||
## Editors | ||
|
||
## Roadmap | ||
To get started with `gopls`, install an LSP plugin in your editor of choice. | ||
|
||
The current goal is a fully stable build with the existing feature set, aiming | ||
for the first half of 2020, with release candidates earlier in the year. | ||
* [VSCode](https://github.com/golang/vscode-go/blob/master/README.md) | ||
* [Vim / Neovim](doc/vim.md) | ||
* [Emacs](doc/emacs.md) | ||
* [Atom](https://github.com/MordFustang21/ide-gopls) | ||
* [Sublime Text](doc/subl.md) | ||
* [Acme](https://github.com/fhs/acme-lsp) | ||
|
||
This will be the first build that we recommend people use, and will be tagged as the 1.0 version. | ||
You can see the set of things being worked on in the [1.0 milestone], in general | ||
we are focused on stability, specifically, making sure we have a reliable service that produces an experience in module mode that is not a retrograde step from the old tools in GOPATH mode. | ||
If you use `gopls` with an editor that is not on this list, please let us know | ||
by [filing an issue](#new-issue) or [modifying this documentation](doc/contributing.md). | ||
|
||
There is also considerable effort being put into testing in order to make sure that we both have a stable service and also that we do not regress after launch. | ||
## Installation | ||
|
||
While we may continue to accept contributions for new features, they may be turned off behind a configuration flag if they are not yet stable. See the [gopls unplanned] milestone for deprioritized features. | ||
For the most part, you should not need to install or update `gopls`. Your | ||
editor should handle that step for you. | ||
|
||
This is just a milestone for gopls itself. We work with editor integrators to make sure they can use the latest builds of gopls, and will help them use the 1.0 version as soon as it is ready, but that does not imply anything about the stability, supported features or version of the plugins. | ||
If you do want to get the latest stable version of `gopls`, change to any | ||
directory that is both outside of your `GOPATH` and outside of a module (a temp | ||
directory is fine), and run: | ||
|
||
## Using | ||
```sh | ||
GO111MODULE=on go get golang.org/x/tools/gopls@latest | ||
``` | ||
|
||
In general you should not need to know anything about gopls, it should be integrated into your editor for you. | ||
**NOTE**: Do not use the `-u` flag, as it will update your dependencies to | ||
incompatible versions. | ||
|
||
To install for your specific editor you can follow the following instructions | ||
Learn more in the [advanced installation | ||
instructions](doc/advanced.md#installing-unreleased-versions). | ||
|
||
* [VSCode](doc/vscode.md) | ||
* [Vim / Neovim](doc/vim.md) | ||
* [Emacs](doc/emacs.md) | ||
* [Acme](doc/acme.md) | ||
* [Sublime Text](doc/subl.md) | ||
* [Atom](doc/atom.md) | ||
## Setting up your workspace | ||
|
||
`gopls` supports both Go module and GOPATH modes, but if you are working with | ||
multiple modules or uncommon project layouts, you will need to specifically | ||
configure your workspace. See the [Workspace document](doc/workspace.md) for | ||
information on supported workspace layouts. | ||
|
||
## Configuration | ||
|
||
You can configure `gopls` to change your editor experience or view additional | ||
debugging information. Configuration options will be made available by your | ||
editor, so see your [editor's instructions](#editors) for specific details. A | ||
full list of `gopls` settings can be found in the [Settings documentation](doc/settings.md). | ||
|
||
See the [user guide](doc/user.md) for more information, including the how to install gopls by hand if you need. | ||
### Environment variables | ||
|
||
## Issues | ||
`gopls` inherits your editor's environment, so be aware of any environment | ||
variables you configure. Some editors, such as VS Code, allow users to | ||
selectively override the values of some environment variables. | ||
|
||
If you are having issues with gopls, please first check the [known issues](doc/status.md#known-issues) before following the [troubleshooting](doc/troubleshooting.md#steps) guide. | ||
If that does not give you the information you need, reach out to us. | ||
## Troubleshooting | ||
|
||
You can chat with us on: | ||
* the golang-tools [mailing list] | ||
* the #gopls [slack channel] on the gophers slack | ||
If you are having issues with `gopls`, please follow the steps described in the | ||
[troubleshooting guide](doc/troubleshooting.md). | ||
|
||
If you think you have an issue that needs fixing, or a feature suggestion, then please make sure you follow the steps to [file an issue](doc/troubleshooting.md#file-an-issue) with the right information to allow us to address it. | ||
## Supported Go versions and build systems | ||
|
||
If you need to talk to us directly (for instance to file an issue with confidential information in it) you can reach out directly to [@stamblerre] or [@ianthehat]. | ||
`gopls` follows the | ||
[Go Release Policy](https://golang.org/doc/devel/release.html#policy), | ||
meaning that it officially supports the last 2 major Go releases. Though we | ||
try not to break older versions, we do not prioritize issues only affecting | ||
legacy Go releases. | ||
|
||
## More information | ||
`gopls` currently only supports the `go` command, so if you are using a | ||
different build system, `gopls` will not work well. Bazel support is currently | ||
blocked on | ||
[bazelbuild/rules_go#512](https://github.com/bazelbuild/rules_go/issues/512). | ||
|
||
If you want to know more about it, have an unusual use case, or want to contribute, please read the following documents | ||
## Additional information | ||
|
||
* [Using gopls](doc/user.md) | ||
* [Troubleshooting and reporting issues](doc/troubleshooting.md) | ||
* [Integrating gopls with an editor](doc/integrating.md) | ||
* [Contributing to gopls](doc/contributing.md) | ||
* [Design requirements and decisions](doc/design.md) | ||
* [Implementation details](doc/implementation.md) | ||
* [Features](doc/features.md) | ||
* [Command-line interface](doc/command-line.md) | ||
* [Advanced topics](doc/advanced.md) | ||
* [Contributing to `gopls`](doc/contributing.md) | ||
* [Integrating `gopls` with an editor](doc/design/integrating.md) | ||
* [Design requirements and decisions](doc/design/design.md) | ||
* [Implementation details](doc/design/implementation.md) | ||
* [Open issues](https://github.com/golang/go/issues?q=is%3Aissue+is%3Aopen+label%3Agopls) | ||
|
||
[language server]: https://langserver.org | ||
[mailing list]: https://groups.google.com/forum/#!forum/golang-tools | ||
[slack channel]: https://gophers.slack.com/messages/CJZH85XCZ | ||
[@stamblerre]: https://github.com/stamblerre "Rebecca Stambler" | ||
[@ianthehat]: https://github.com/ianthehat "Ian Cottrell" | ||
[1.0 milestone]: https://github.com/golang/go/milestone/112 | ||
[gopls unplanned]: https://github.com/golang/go/milestone/124 | ||
[LSP]: https://microsoft.github.io/language-server-protocol/ | ||
[Gophers Slack]: https://gophers.slack.com/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Advanced topics | ||
|
||
This documentation is for advanced `gopls` users, who may want to test | ||
unreleased versions or try out special features. | ||
|
||
## Installing unreleased versions | ||
|
||
To get a specific version of `gopls` (for example, to test a prerelease | ||
version), run: | ||
|
||
```sh | ||
GO111MODULE=on go get golang.org/x/tools/gopls@vX.Y.Z | ||
``` | ||
|
||
Where `vX.Y.Z` is the desired version. | ||
|
||
### Unstable versions | ||
|
||
To update `gopls` to the latest **unstable** version, use: | ||
|
||
```sh | ||
GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master | ||
``` | ||
|
||
## Working on the Go source distribution | ||
|
||
If you are working on the [Go project] itself, the `go` command that `gopls` | ||
invokes will have to correspond to the version of the source you are working | ||
on. That is, if you have checked out the Go project to `$HOME/go`, your `go` | ||
command should be the `$HOME/go/bin/go` executable that you built with | ||
`make.bash` or equivalent. | ||
|
||
You can achieve this by adding the right version of `go` to your `PATH` | ||
(`export PATH=$HOME/go/bin:$PATH` on Unix systems) or by configuring your | ||
editor. | ||
|
||
[Go project]: https://go.googlesource.com/go |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.