[gopls-release-branch.0.6] all: merge master into gopls-release-branch.0.6

fe37c9e1 all: replace all usages of os/exec with golang.org/x/sys/execabs
a46736d9 internal/lsp/source: handle possible nil pointer in rename check
e0d20156 gopls/doc: rewrite troubleshooting.md
d78b04bd gopls/doc: clean up and slightly reorganize documentation
1bdb73f5 gopls/doc: move contents of golang/go#36899 to documentation
f9643685 gopls/internal/regtest: fix synchronization for TestUseGoplsMod
8b4aab62 gopls/doc/vscode.md: update vscode setting example

Change-Id: Iec71457cdff70ef15b77cf4193a0006f5ca47c01
diff --git a/cmd/auth/authtest/authtest.go b/cmd/auth/authtest/authtest.go
index 263eed8..0489b93 100644
--- a/cmd/auth/authtest/authtest.go
+++ b/cmd/auth/authtest/authtest.go
@@ -18,13 +18,13 @@
 	"bytes"
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"log"
 	"net/http"
 	"net/textproto"
 	"net/url"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"strings"
 )
diff --git a/cmd/auth/gitauth/gitauth.go b/cmd/auth/gitauth/gitauth.go
index b481fe6..7bfca6e 100644
--- a/cmd/auth/gitauth/gitauth.go
+++ b/cmd/auth/gitauth/gitauth.go
@@ -16,11 +16,11 @@
 import (
 	"bytes"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"net/http"
 	"net/url"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"strings"
 )
diff --git a/cmd/compilebench/main.go b/cmd/compilebench/main.go
index afce218..d7da6d5 100644
--- a/cmd/compilebench/main.go
+++ b/cmd/compilebench/main.go
@@ -82,10 +82,10 @@
 	"encoding/json"
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"strconv"
diff --git a/cmd/cover/html.go b/cmd/cover/html.go
index ef50e2b..0f8c725 100644
--- a/cmd/cover/html.go
+++ b/cmd/cover/html.go
@@ -8,12 +8,12 @@
 	"bufio"
 	"bytes"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"html/template"
 	"io"
 	"io/ioutil"
 	"math"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime"
 
diff --git a/cmd/eg/eg.go b/cmd/eg/eg.go
index 9199f42..a5473ad 100644
--- a/cmd/eg/eg.go
+++ b/cmd/eg/eg.go
@@ -14,8 +14,8 @@
 	"go/format"
 	"go/parser"
 	"go/token"
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"strings"
 
 	"golang.org/x/tools/go/buildutil"
diff --git a/cmd/fiximports/main.go b/cmd/fiximports/main.go
index 53a9944..f572a15 100644
--- a/cmd/fiximports/main.go
+++ b/cmd/fiximports/main.go
@@ -79,11 +79,11 @@
 	"go/format"
 	"go/parser"
 	"go/token"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path"
 	"path/filepath"
 	"sort"
diff --git a/cmd/getgo/main.go b/cmd/getgo/main.go
index 792ea05..417e860 100644
--- a/cmd/getgo/main.go
+++ b/cmd/getgo/main.go
@@ -13,8 +13,8 @@
 	"errors"
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"strings"
 )
 
diff --git a/cmd/getgo/system.go b/cmd/getgo/system.go
index 07d6f85..232ca36 100644
--- a/cmd/getgo/system.go
+++ b/cmd/getgo/system.go
@@ -9,7 +9,7 @@
 import (
 	"bytes"
 	"context"
-	"os/exec"
+	exec "golang.org/x/sys/execabs"
 	"runtime"
 	"strings"
 )
diff --git a/cmd/go-contrib-init/contrib.go b/cmd/go-contrib-init/contrib.go
index 7c65746..e2bb507 100644
--- a/cmd/go-contrib-init/contrib.go
+++ b/cmd/go-contrib-init/contrib.go
@@ -13,10 +13,10 @@
 	"flag"
 	"fmt"
 	"go/build"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"runtime"
diff --git a/cmd/godoc/goroot.go b/cmd/godoc/goroot.go
index 755069d..c284ca8 100644
--- a/cmd/godoc/goroot.go
+++ b/cmd/godoc/goroot.go
@@ -5,8 +5,8 @@
 package main
 
 import (
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime"
 	"strings"
diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go
index 7dba4d2..02f0eb6 100644
--- a/cmd/godoc/main.go
+++ b/cmd/godoc/main.go
@@ -25,13 +25,13 @@
 	"flag"
 	"fmt"
 	"go/build"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"log"
 	"net/http"
 	_ "net/http/pprof" // to serve /debug/pprof/*
 	"net/url"
 	"os"
-	"os/exec"
 	"path"
 	"path/filepath"
 	"regexp"
diff --git a/cmd/goimports/goimports.go b/cmd/goimports/goimports.go
index 2770897..b354c9e 100644
--- a/cmd/goimports/goimports.go
+++ b/cmd/goimports/goimports.go
@@ -11,11 +11,11 @@
 	"flag"
 	"fmt"
 	"go/scanner"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime"
 	"runtime/pprof"
diff --git a/cmd/stress/stress.go b/cmd/stress/stress.go
index e127735..4ff6cf3 100644
--- a/cmd/stress/stress.go
+++ b/cmd/stress/stress.go
@@ -17,9 +17,9 @@
 import (
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"runtime"
diff --git a/cmd/toolstash/main.go b/cmd/toolstash/main.go
index b462b50..4c34942 100644
--- a/cmd/toolstash/main.go
+++ b/cmd/toolstash/main.go
@@ -127,11 +127,11 @@
 	"bufio"
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime"
 	"strings"
diff --git a/go.mod b/go.mod
index 57607cb..aaefd1f 100644
--- a/go.mod
+++ b/go.mod
@@ -7,5 +7,6 @@
 	golang.org/x/mod v0.3.0
 	golang.org/x/net v0.0.0-20201021035429-f5854403a974
 	golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
+	golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
 	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
 )
diff --git a/go.sum b/go.sum
index 1608006..12a6e94 100644
--- a/go.sum
+++ b/go.sum
@@ -15,6 +15,8 @@
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
diff --git a/go/internal/cgo/cgo.go b/go/internal/cgo/cgo.go
index 5db8b30..9772504 100644
--- a/go/internal/cgo/cgo.go
+++ b/go/internal/cgo/cgo.go
@@ -57,10 +57,10 @@
 	"go/build"
 	"go/parser"
 	"go/token"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"strings"
diff --git a/go/internal/cgo/cgo_pkgconfig.go b/go/internal/cgo/cgo_pkgconfig.go
index b5bb95a..7d94bbc 100644
--- a/go/internal/cgo/cgo_pkgconfig.go
+++ b/go/internal/cgo/cgo_pkgconfig.go
@@ -8,7 +8,7 @@
 	"errors"
 	"fmt"
 	"go/build"
-	"os/exec"
+	exec "golang.org/x/sys/execabs"
 	"strings"
 )
 
diff --git a/go/internal/gccgoimporter/gccgoinstallation.go b/go/internal/gccgoimporter/gccgoinstallation.go
index fac4100..365521e 100644
--- a/go/internal/gccgoimporter/gccgoinstallation.go
+++ b/go/internal/gccgoimporter/gccgoinstallation.go
@@ -10,8 +10,8 @@
 import (
 	"bufio"
 	"go/types"
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"strings"
 )
diff --git a/go/packages/external.go b/go/packages/external.go
index 7db1d12..7242a0a 100644
--- a/go/packages/external.go
+++ b/go/packages/external.go
@@ -12,8 +12,8 @@
 	"bytes"
 	"encoding/json"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"strings"
 )
 
diff --git a/go/packages/golist.go b/go/packages/golist.go
index c83ca09..ec417ba 100644
--- a/go/packages/golist.go
+++ b/go/packages/golist.go
@@ -10,10 +10,10 @@
 	"encoding/json"
 	"fmt"
 	"go/types"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path"
 	"path/filepath"
 	"reflect"
diff --git a/go/pointer/util.go b/go/pointer/util.go
index 986dd09..5bdd623 100644
--- a/go/pointer/util.go
+++ b/go/pointer/util.go
@@ -8,9 +8,9 @@
 	"bytes"
 	"fmt"
 	"go/types"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"os"
-	"os/exec"
 	"runtime"
 	"time"
 
diff --git a/go/vcs/vcs.go b/go/vcs/vcs.go
index 1deb813..f2aac1c 100644
--- a/go/vcs/vcs.go
+++ b/go/vcs/vcs.go
@@ -19,10 +19,10 @@
 	"encoding/json"
 	"errors"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"net/url"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"strconv"
diff --git a/gopls/doc/acme.md b/gopls/doc/acme.md
index 69dd749..e62a028 100644
--- a/gopls/doc/acme.md
+++ b/gopls/doc/acme.md
@@ -1,7 +1,7 @@
 # Acme
 
-Use the experimental [`acme-lsp`], simply follow the [install steps]
+Use the experimental [`acme-lsp`] plugin.
+Get started by following the[installation guide].
 
 [`acme-lsp`]: https://github.com/fhs/acme-lsp
-[install steps]: https://github.com/fhs/acme-lsp#gopls
-
+[installation guide]: https://github.com/fhs/acme-lsp#gopls
diff --git a/gopls/doc/atom.md b/gopls/doc/atom.md
index 7af0289..ce1d094 100644
--- a/gopls/doc/atom.md
+++ b/gopls/doc/atom.md
@@ -1,6 +1,6 @@
 # Atom
 
-Install the [`ide-gopls`] package.
+Use the [`ide-gopls`] package.
 You will also need to install the [`atom-ide-ui`] package.
 
 [`ide-gopls`]: https://github.com/MordFustang21/ide-gopls
diff --git a/gopls/doc/command-line.md b/gopls/doc/command-line.md
index 3816460..6865799 100644
--- a/gopls/doc/command-line.md
+++ b/gopls/doc/command-line.md
@@ -1,15 +1,17 @@
 # Command line
 
-## Flags
+**Note: The `gopls` command-line is still experimental and subject to change at any point.**
 
-## Commands
+`gopls` exposes some (but not all) features on the command-line. This can be useful for debugging `gopls` itself.
 
-### Serve
+<!--TODO(rstambler): Generate this file.-->
 
-### Check
+Learn about available commands and flags by running `gopls help`.
 
-### Format
+Much of the functionality of `gopls` is available through a command line interface.
 
-<!--- TODO: command line
-detailed command line instructions, use cases and flags
---->
\ No newline at end of file
+There are two main reasons for this. The first is that we do not want users to rely on separate command line tools when they wish to do some task outside of an editor. The second is that the CLI assists in debugging. It is easier to reproduce behavior via single command.
+
+It is not a goal of `gopls` to be a high performance command line tool. Its command line is intended for single file/package user interaction speeds, not bulk processing.
+
+For more information, see the `gopls` [command line page](command-line.md).
diff --git a/gopls/doc/contributing.md b/gopls/doc/contributing.md
index 091e298..b285a30 100644
--- a/gopls/doc/contributing.md
+++ b/gopls/doc/contributing.md
@@ -9,15 +9,35 @@
 
 ## Finding issues
 
-All `gopls` issues are labeled as such (see the [`gopls` label][issue-gopls]). Issues that are suitable for contributors are additionally tagged with the [`help-wanted` label][issue-wanted].
+All `gopls` issues are labeled as such (see the [`gopls` label][issue-gopls]).
+Issues that are suitable for contributors are additionally tagged with the
+[`help-wanted` label][issue-wanted].
 
-Before you begin working on an issue, please leave a comment that you are claiming it.
+Before you begin working on an issue, please leave a comment that you are
+claiming it.
 
 ## Getting started
 
-<!--- TODO: getting started
-Provide information to get contributors up and running here
---->
+Most of the `gopls` logic is actually in the `golang.org/x/tools/internal/lsp`
+directory, so you are most likely to develop in the golang.org/x/tools module.
+
+## Build
+
+To build a version of `gopls` with your changes applied:
+
+```bash
+cd /path/to/tools/gopls
+go install
+```
+
+To confirm that you are testing with the correct `gopls` version, check that
+your `gopls` version looks like this:
+
+```bash
+$ gopls version
+golang.org/x/tools/gopls master
+    golang.org/x/tools/gopls@(devel)
+```
 
 ## Getting help
 
@@ -30,21 +50,24 @@
 
 To run tests for just `gopls/`, run,
 
-```
+```bash
 cd /path/to/tools/gopls
 go test ./...
 ```
 
-But, much of the gopls work involves `internal/lsp` too, so you might want to
+But, much of the gopls work involves `internal/lsp` too, so you will want to
 run both:
 
-```
+```bash
 cd /path/to/tools
 cd gopls && go test ./...
 cd ..
 go test ./internal/lsp/...
 ```
 
+There is additional information about the `internal/lsp` tests in the
+[internal/lsp/tests `README`](https://github.com/golang/tools/blob/master/internal/lsp/tests/README.md).
+
 ### Regtests
 
 gopls has a suite of regression tests defined in the `./gopls/internal/regtest`
@@ -78,10 +101,11 @@
 
 ## Debugging
 
-<!--- TODO: debugging
-actual debugging steps
-viewing telemetry
---->
+The easiest way to debug your change is to run can run a single `gopls` test
+with a debugger.
+
+<!--TODO(rstambler): Add more details about the debug server and viewing
+telemetry.-->
 
 [issue-gopls]: https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Agopls "gopls issues"
 [issue-wanted]: https://github.com/golang/go/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Agopls+label%3A"help+wanted" "help wanted"
diff --git a/gopls/doc/daemon.md b/gopls/doc/daemon.md
index d65a021..ea9c4e2 100644
--- a/gopls/doc/daemon.md
+++ b/gopls/doc/daemon.md
@@ -40,8 +40,9 @@
 cause this process to auto-start the gopls daemon if needed, connect to it, and
 forward the LSP. For example, here is a reasonable gopls invocation, that sets
 some additional flags for easier [debugging](#debugging):
-```
-$ gopls -remote=auto -logfile=auto -debug=:0 -remote.debug=:0 -rpc.trace
+
+```bash
+gopls -remote=auto -logfile=auto -debug=:0 -remote.debug=:0 -rpc.trace
 ```
 
 Note that the shared gopls process will automatically shut down after one
@@ -55,23 +56,28 @@
 started by your editor.
 
 For example, to host the daemon on the TCP port `37374`, do:
-```
-$ gopls -listen=:37374 -logfile=auto -debug=:0
+
+```bash
+gopls -listen=:37374 -logfile=auto -debug=:0
 ```
 
 And then from the editor, run
-```
-$ gopls -remote=:37374 -logfile=auto -debug=:0 -rpc.trace
+
+```bash
+gopls -remote=:37374 -logfile=auto -debug=:0 -rpc.trace
 ```
 
 If you are on a POSIX system, you can also use unix domain sockets by prefixing
 the flag values with `unix;`. For example:
+
+```bash
+gopls -listen="unix;/tmp/gopls-daemon-socket" -logfile=auto -debug=:0
 ```
-$ gopls -listen="unix;/tmp/gopls-daemon-socket" -logfile=auto -debug=:0
-```
+
 And connect via:
-```
-$ gopls -remote="unix;/tmp/gopls-daemon-socket" -logfile=auto -debug=:0 -rpc.trace
+
+```bash
+gopls -remote="unix;/tmp/gopls-daemon-socket" -logfile=auto -debug=:0 -rpc.trace
 ```
 
 (Note that these flag values MUST be enclosed in quotes, because ';' is a
diff --git a/gopls/doc/design.md b/gopls/doc/design/design.md
similarity index 99%
rename from gopls/doc/design.md
rename to gopls/doc/design/design.md
index 6edd9aa..05f449d 100644
--- a/gopls/doc/design.md
+++ b/gopls/doc/design/design.md
@@ -1,4 +1,4 @@
-# gopls design documentation
+# `gopls` design documentation
 
 ## Goals
 
@@ -7,7 +7,6 @@
 * `gopls` will be **clean and extensible** so that it can encompass additional features in the future, allowing Go tooling to become best in class once more.
 * `gopls` will **support alternate build systems and file layouts**, allowing Go development to be simpler and more powerful in any environment.
 
-
 ## Context
 
 While Go has a number of excellent and useful command-line tools that enhance the developer experience, it has become clear that integrating these tools with IDEs can pose challenges.
@@ -170,7 +169,6 @@
 
 There needs to be easy ways for users to report what information they can, and ways to attempt to reproduce problems without their entire state. This is also needed to produce regression tests.
 
-
 ## Basic design decisions
 
 There are some fundamental architecture decisions that affect much of the rest of the design of the tool, making fundamental trade offs that impact the user experience.
@@ -208,6 +206,8 @@
 
 ## Features
 
+<!--TODO(rstambler): Generate a file that lists all of the supported features.-->
+
 There is a set of features that gopls needs to expose to be a comprehensive IDE solution.
 The following is the minimum set of features, along with their existing solutions and how they should map to the LSP.
 
@@ -239,7 +239,6 @@
 Previous       | [gogetdoc]
 |              | As a function call is being typed into code, it is helpful to know the parameters of that call to enable the developer to call it correctly.
 
-
 ### Navigation
 
 Navigation features are designed to make it easier for a developer to find their way round a code base.
@@ -278,7 +277,6 @@
 Previous   | [guru]
 |          | This requires knowledge of every package that could possible depend on any packages the current file is part of. In the past this has been implemented either by global knowledge, which does not scale, or by specifying a "scope" which confused users to the point where they just did not use the tools. gopls is probably going to need a more powerful solution in the long term, but to start with automatically limiting the scope may produce acceptable results. This would probably be the module if known, or some sensible parent directory otherwise.
 
-
 ---
 Folding  | Report logical hierarchies of blocks
 -------- | ---
@@ -314,7 +312,6 @@
 Previous | [gofmt], [goimports], [goreturns]
 |        | It will use the standard format package. <br/> Current limitations are that it does not work on malformed code. It may need some very careful changes to the formatter to allow for formatting an invalid AST or changes to force the AST to a valid mode. These changes would improve range and file mode as well, but are basically vital to onTypeFormatting
 
-
 ---
 Imports  | Rewrite the imports block automatically to match the symbols used.
 -------- | ---
@@ -323,7 +320,6 @@
 Previous | [goimports], [goreturns]
 |        | This needs knowledge of packages that are not yet in use, and the ability to find those packages by name. <br/> It also needs exported symbol information for all the packages it discovers. <br/> It should be implemented using the standard imports package, but there may need to be exposed a more fine grained API than just a file rewrite for some of the interactions.
 
-
 ---
 Autocompletion | Makes suggestions to complete the entity currently being typed.
 -------------- | ---
@@ -350,7 +346,6 @@
 Previous        | N/A
 |               | This is a brand new feature powered by the new go/analysis engine, and it should allow a huge amount of automated refactoring.
 
-
 [LSP specification]: https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/
 [talk]: TODO
 [slides]: https://github.com/gophercon/2019-talks/blob/master/RebeccaStambler-GoPleaseStopBreakingMyEditor/slides.pdf "Go, please stop breaking my editor!"
@@ -375,7 +370,6 @@
 [go/ast]: https://golang.org/pkg/go/ast/
 [go/token]: https://golang.org/pkg/go/token/
 
-
 [`completionItem/resolve`]:https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#completionItem_resolve
 [`textDocument/codeAction`]: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#textDocument_codeAction
 [`textDocument/completion`]: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-14.md#textDocument_completion
diff --git a/gopls/doc/implementation.md b/gopls/doc/design/implementation.md
similarity index 100%
rename from gopls/doc/implementation.md
rename to gopls/doc/design/implementation.md
diff --git a/gopls/doc/integrating.md b/gopls/doc/design/integrating.md
similarity index 100%
rename from gopls/doc/integrating.md
rename to gopls/doc/design/integrating.md
diff --git a/gopls/doc/emacs.md b/gopls/doc/emacs.md
index f8d75cc..707dd90 100644
--- a/gopls/doc/emacs.md
+++ b/gopls/doc/emacs.md
@@ -28,12 +28,10 @@
 Both Eglot and LSP Mode can integrate with popular packages in the Emacs
 ecosystem:
 
-*   The built-in [`xref`] package provides cross-references.
-
-*   The built-in [Flymake] package provides an on-the-fly diagnostic overlay.
-
-*   [Company] mode displays code completion candidates (with a richer UI than
-    the built-in [`completion-at-point`]).
+* The built-in [`xref`] package provides cross-references.
+* The built-in [Flymake] package provides an on-the-fly diagnostic overlay.
+* [Company] mode displays code completion candidates (with a richer UI than
+  the built-in [`completion-at-point`]).
 
 Eglot provides documentation using the built-in [ElDoc] minor mode, while LSP
 Mode by default provides documentation using its own [`lsp-ui`] mode.
@@ -151,18 +149,18 @@
 
 Common errors:
 
--   When prompted by Emacs for your project folder, if you are using modules you
-    must select the module's root folder (i.e. the directory with the "go.mod").
-    If you are using GOPATH, select your $GOPATH as your folder.
--   Emacs must have your environment set properly (PATH, GOPATH, etc). You can
-    run `M-x getenv <RET> PATH <RET>` to see if your PATH is set in Emacs. If
-    not, you can try starting Emacs from your terminal, using [this
-    package][exec-path-from-shell], or moving your shell config from `.bashrc`
-    into `.profile` and logging out and back in.
--   Make sure only one LSP client mode is installed. (For example, if using
-    `lsp-mode`, ensure that you are not _also_ enabling `eglot`.)
--   Look for errors in the `*lsp-log*` buffer or run `M-x eglot-events-buffer`.
--   Ask for help in the `#emacs` channel on the [Gophers slack].
+* When prompted by Emacs for your project folder, if you are using modules you
+  must select the module's root folder (i.e. the directory with the "go.mod").
+  If you are using GOPATH, select your $GOPATH as your folder.
+* Emacs must have your environment set properly (PATH, GOPATH, etc). You can
+  run `M-x getenv <RET> PATH <RET>` to see if your PATH is set in Emacs. If
+  not, you can try starting Emacs from your terminal, using [this
+  package][exec-path-from-shell], or moving your shell config from `.bashrc`
+  into `.profile` and logging out and back in.
+* Make sure only one LSP client mode is installed. (For example, if using
+  `lsp-mode`, ensure that you are not _also_ enabling `eglot`.)
+* Look for errors in the `*lsp-log*` buffer or run `M-x eglot-events-buffer`.
+* Ask for help in the `#emacs` channel on the [Gophers slack].
 
 [LSP Mode]: https://emacs-lsp.github.io/lsp-mode/
 [Eglot]: https://github.com/joaotavora/eglot/blob/master/README.md
diff --git a/gopls/doc/faq.md b/gopls/doc/faq.md
deleted file mode 100644
index e4980f5..0000000
--- a/gopls/doc/faq.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# gopls FAQ
-
-## Why is it called gopls?
-
-Since gopls works both as a language server and as a command line tool, we wanted a name that could be used as a verb. For example, gopls check should read as "go please check." See: [cl/158197].
-
-[cl/158197]: https://golang.org/cl/158197
\ No newline at end of file
diff --git a/gopls/doc/features.md b/gopls/doc/features.md
new file mode 100644
index 0000000..9cb6864
--- /dev/null
+++ b/gopls/doc/features.md
@@ -0,0 +1,24 @@
+# Features
+
+This document describes some of the features supported by `gopls`. It is
+currently under construction, so, for a comprehensive list, see the
+[Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
+
+For now, only special features outside of the LSP are described below.
+
+## Special features
+
+### Symbol Queries
+
+Gopls supports some extended syntax for `workspace/symbol` requests, when using
+the `fuzzy` symbol matcher (the default). Inspired by the popular fuzzy matcher
+[FZF](https://github.com/junegunn/fzf), the following special characters are
+supported within symbol queries:
+
+| Character | Usage     | Match        |
+| --------- | --------- | ------------ |
+| `'`       | `'abc`    | exact        |
+| `^`       | `^printf` | exact prefix |
+| `$`       | `printf$` | exact suffix |
+
+<!--TODO(rstambler): Automatically generate a list of supported features.-->
diff --git a/gopls/doc/settings.md b/gopls/doc/settings.md
index cf465ce..1f210ed 100644
--- a/gopls/doc/settings.md
+++ b/gopls/doc/settings.md
@@ -12,8 +12,8 @@
 
 ```json5
   "gopls": {
-    "usePlaceholders": true,
-    "completeUnimported": true
+    "ui.completion.usePlaceholders": true,
+     ...
   },
 ```
 
diff --git a/gopls/doc/status.md b/gopls/doc/status.md
deleted file mode 100644
index 435b9ec..0000000
--- a/gopls/doc/status.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Status
-
-gopls is currently in **alpha**, so it is **not stable**.
-
-gopls is currently under active development by the Go team. The code is in the [x/tools] repository, in [golang.org/x/tools/internal/lsp] and [golang.org/x/tools/gopls].
-
-## Supported features
-
-<!--- TODO: supported features
-details and status for the features
-missing features
---->
-
-### Autocompletion
-### Jump to definition
-### Signature help
-### Hover
-### Document symbols
-### References
-### Rename
-
-## Known issues
-
-1. Editing multiple modules in one editor window: [#32394]
-1. Type checking does not work in cgo packages: [#35721]
-1. Does not work with build tags: [#29202]
-1. Find references and rename only work in a single package: [#32877]
-
-[x/tools]: https://github.com/golang/tools
-[golang.org/x/tools/gopls]: https://github.com/golang/tools/tree/master/gopls
-[golang.org/x/tools/internal/lsp]: https://github.com/golang/tools/tree/master/internal/lsp
-
-
-[#32394]: https://github.com/golang/go/issues/32394
-[#35721]: https://github.com/golang/go/issues/35721
-[#29202]: https://github.com/golang/go/issues/29202
-[#32877]: https://github.com/golang/go/issues/32877
diff --git a/gopls/doc/troubleshooting.md b/gopls/doc/troubleshooting.md
index d5696ae..58e5fa4 100644
--- a/gopls/doc/troubleshooting.md
+++ b/gopls/doc/troubleshooting.md
@@ -1,85 +1,48 @@
 # Troubleshooting
 
-If you suspect that `gopls` is crashing or not working correctly, please follow the [troubleshooting steps](#steps) below.
+If you suspect that `gopls` is crashing or not working correctly, please follow the troubleshooting steps below.
 
-If `gopls` is using too much memory, please follow the steps under [Memory usage](#memory-usage).
+If `gopls` is using too much memory, please follow the steps under [Memory usage](#debug-memory-usage).
 
 ## Steps
 
-<!--- TODO: troubleshooting
-describe more basic and optional trouble shooting steps
-  like checking you opened the module root
-  and using the debug pages
---->
+VS Code users should follow [their troubleshooting guide](https://github.com/golang/vscode-go/blob/master/docs/troubleshooting.md), which has more a more specific version of these instructions.
 
-1. Make sure your `gopls` is [up to date](user.md#installing).
-1. Check the [known issues](status.md#known-issues).
-1. [Report the issue](#file-an-issue).
+1. Verify that your project is in good shape by working with it outside of your editor. Running a command like `go build ./...` in the workspace directory will compile everything. For modules, `go mod tidy` is another good check, though it may modify your `go.mod`.
+1. Check that your editor isn't showing any diagnostics that indicate a problem with your workspace. They may appear as diagnostics on a Go file's package declaration, diagnostics in a go.mod file, or as a status or progress message. Problems in the workspace configuration can cause many different symptoms. See the [workspace setup instructions](workspace.md) for help.
+1. Make sure `gopls` is up to date by following the [installation instructions](user.md#installing), then [restarting gopls](#restart-gopls).
+1. Optionally, [ask for help](#ask-for-help) on Gophers Slack.
+1. Finally, [report the issue](#file-an-issue) to the `gopls` developers.
+
+## Restart `gopls`
+
+`gopls` has no persistent state, so restarting it will fix transient problems. This is good and bad: good, because you can keep working, and bad, because you won't be able to debug the issue until it recurs.
+
+In most cases, closing all your open editors will guarantee that `gopls` is killed and restarted. If you don't want to do that, there may be an editor command you can use to restart only `gopls`. Note that some `vim` configurations keep the server alive for a while after the editor exits; you may need to explicitly kill `gopls` if you use `vim`.
+
+## Ask for help
+
+Gophers Slack has active editor-specific channels like [#emacs](https://gophers.slack.com/archives/C0HKHULEM), [#vim](https://gophers.slack.com/archives/C07GBR52P), and [#vscode](https://gophers.slack.com/archives/C2B4L99RS) that can help debug further. If you're confident the problem is with `gopls`, you can go straight to [#gopls](https://gophers.slack.com/archives/CJZH85XCZ). Invites are [available to everyone](https://invite.slack.golangbridge.org). Come prepared with a short description of the issue, and try to be available to answer questions for a while afterward.
 
 ## File an issue
 
-You can use:
-
-* Your editor's bug submission integration (if available). For instance, `:GoReportGitHubIssue` in [`vim-go`](vim.md#vim-go).
-* `gopls bug` on the command line.
-* The [Go issue tracker](https://github.com/golang/go/issues/new?title=x%2Ftools%2Fgopls%3A%20%3Cfill%20this%20in%3E).
-
-Along with an explanation of the issue, please share the information listed here:
+We can't diagnose a problem from just a description. When filing an issue, please include as much as possible of the following information:
 
 1. Your editor and any settings you have configured (for example, your VSCode `settings.json` file).
 1. A sample program that reproduces the issue, if possible.
 1. The output of `gopls version` on the command line.
-1. The output of `gopls -rpc.trace -v check /path/to/file.go`.
-1. gopls logs from when the issue occurred, as well as a timestamp for when the issue began to occur. See the [instructions](#capturing-gopls-logs) for information on how to capture gopls logs.
+1. A complete gopls log file from a session where the issue occurred. It should have a `go env for <workspace folder>` log line near the beginning. It's also helpful to tell us the timestamp the problem occurred, so we can find it the log. See the [instructions](#capture-logs) for information on how to capture gopls logs.
 
-Much of this information is filled in for you if you use `gopls bug` to file the issue.
+Your editor may have a command that fills out some of the necessary information, such as `:GoReportGitHubIssue` in `vim-go`. Otherwise, you can use `gopls bug` on the command line. If neither of those work you can start from scratch directly on the [Go issue tracker](https://github.com/golang/go/issues/new?title=x%2Ftools%2Fgopls%3A%20%3Cfill%20this%20in%3E).
 
-### Capturing logs
+## Capture logs
 
-#### VS Code
-
-For VSCode users, the gopls log can be found by navigating to `View` -> `Output` (or `Ctrl+K Ctrl+H`). There will be a drop-down menu titled `Tasks` in the top-right corner. Select the `gopls (server)` item, which will contain the `gopls` logs.
-
-To increase the level of detail in your logs, add the following to your VS Code settings:
-
-```json5
-"go.languageServerFlags": [
-  "-rpc.trace"
-]
-```
-
-To start a debug server that will allow you to see profiles and memory usage, add the following to your VS Code settings:
-
-```json5
-"go.languageServerFlags": [
-  "serve",
-  "-rpc.trace",
-  "--debug=localhost:6060",
-],
-```
-
-You will then be able to view debug information by navigating to `localhost:6060`.
-
-#### Other editors
-
-For other editors, you may have to directly pass a `-logfile` flag to gopls.
+You may have to change your editor's configuration to pass a `-logfile` flag to gopls.
 
 To increase the level of detail in your logs, start `gopls` with the `-rpc.trace` flag. To start a debug server that will allow you to see profiles and memory usage, start `gopls` with `serve --debug=localhost:6060`. You will then be able to view debug information by navigating to `localhost:6060`.
 
 If you are unsure of how to pass a flag to `gopls` through your editor, please see the [documentation for your editor](user.md#editors).
 
-### Restart your editor
+## Debug memory usage
 
-Once you have filed an issue, you can then try to restart your `gopls` instance by restarting your editor. In many cases, this will correct the problem. In VSCode, the easiest way to restart the language server is by opening the command palette (Ctrl + Shift + P) and selecting `"Go: Restart Language Server"`. You can also reload the VSCode instance by selecting `"Developer: Reload Window"`.
-
-## Memory usage
-
-`gopls` automatically writes out memory debug information when your usage
-exceeds 1GB. This information can be found in your temporary directory with
-names like `gopls.1234-5GiB-withnames.zip`. On Windows, your temporary
-directory will be located at `%TMP%`, and on Unixes, it will be `$TMPDIR`,
-which is usually `/tmp`. Please create a
-[new issue](https://github.com/golang/go/issues/new?title=x%2Ftools%2Fgopls%3A%20%3Cfill%20this%20in%3E)
-with your editor settings and memory debug information attached. If you are
-uncomfortable sharing the package names of your code, you can share the
-`-nonames` zip instead.
+`gopls` automatically writes out memory debug information when your usage exceeds 1GB. This information can be found in your temporary directory with names like `gopls.1234-5GiB-withnames.zip`. On Windows, your temporary directory will be located at `%TMP%`, and on Unixes, it will be `$TMPDIR`, which is usually `/tmp`. Please [file an issue](#file-an-issue) with this memory debug information attached. If you are uncomfortable sharing the package names of your code, you can share the `-nonames` zip instead, but it's much less useful.
diff --git a/gopls/doc/user.md b/gopls/doc/user.md
index 4f2f06f..fce4b9b 100644
--- a/gopls/doc/user.md
+++ b/gopls/doc/user.md
@@ -1,13 +1,11 @@
 # User guide
 
-##### If you're having issues with `gopls`, please see the [troubleshooting guide](troubleshooting.md).
-
-This document focuses on VSCode, as at the time of writing, VSCode is the most popular Go editor. However, most of the features described here work in any editor. The settings should be easy to translate to those of another editor's LSP client. The differences will be in the place where you define the settings and the syntax with which you declare them.
+**If you're having issues with `gopls`, please see the
+[troubleshooting guide](troubleshooting.md).**
 
 ## Editors
 
-The following is the list of editors with known integrations.
-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](#contribute).
+The following is the list of editors with known integrations for `gopls`.
 
 * [VSCode](vscode.md)
 * [Vim / Neovim](vim.md)
@@ -16,6 +14,19 @@
 * [Sublime Text](subl.md)
 * [Atom](atom.md)
 
+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](contributing.md).
+
+## Overview
+
+* [Installation](#installation)
+* [Configuration](#configuration)
+
+Learn more at the following pages:
+
+* [Features](features.md)
+* [Command-line](command-line.md)
+
 ## Installation
 
 For the most part, you should not need to install or update `gopls`. Your editor should handle that step for you.
@@ -72,35 +83,51 @@
 verify that the `gopls` tests pass for the last 4 major Go releases, but do not
 prioritize issues only affecting legacy Go release (3 or 4 releases ago).
 
-## Configurations
+## Configuration
 
 ### Environment variables
 
-These are often inherited from the editor that launches `gopls`, and sometimes the editor has a way to add or replace values before launching. For example, VSCode allows you to configure `go.toolsEnvVars`.
+These are often inherited from the editor that launches `gopls`, and sometimes
+the editor has a way to add or replace values before launching. For example,
+VSCode allows you to configure `go.toolsEnvVars`.
 
-Configuring your environment correctly is important, as `gopls` relies on the `go` command.
+Configuring your environment correctly is important, as `gopls` relies on the
+`go` command.
 
-### Command line flags
+### Command-line flags
 
-See the [command line page](command-line.md) for more information about the flags you might specify.
-All editors support some way of adding flags to `gopls`, for the most part you should not need to do this unless you have very unusual requirements or are trying to [troubleshoot](troubleshooting.md#steps) `gopls` behavior.
+See the [command-line page](command-line.md) for more information about the
+flags you might specify. All editors support some way of adding flags to
+`gopls`, for the most part you should not need to do this unless you have very
+unusual requirements or are trying to [troubleshoot](troubleshooting.md#steps)
+`gopls` behavior.
 
 ### Editor settings
 
-For the most part these will be settings that control how the editor interacts with or uses the results of `gopls`, not modifications to `gopls` itself. This means they are not standardized across editors, and you will have to look at the specific instructions for your editor integration to change them.
+For the most part these will be settings that control how the editor interacts
+with or uses the results of `gopls`, not modifications to `gopls` itself. This
+means they are not standardized across editors, and you will have to look at
+the specific instructions for your editor integration to change them.
 
 #### The set of workspace folders
 
-This is one of the most important pieces of configuration. It is the set of folders that gopls considers to be "roots" that it should consider files to be a part of.
+This is one of the most important pieces of configuration. It is the set of
+folders that gopls considers to be "roots" that it should consider files to
+be a part of.
 
-If you are using modules there should be one of these per go.mod that you are working on.
-If you do not open the right folders, very little will work. **This is the most common misconfiguration of `gopls` that we see**.
+If you are using modules there should be one of these per go.mod that you
+are working on. If you do not open the right folders, very little will work.
+**This is the most common misconfiguration of `gopls` that we see**.
 
 #### Global configuration
 
-There should be a way of declaring global settings for `gopls` inside the editor. The settings block will be called `"gopls"` and contains a collection of controls for `gopls` that the editor is not expected to understand or control.
+There should be a way of declaring global settings for `gopls` inside the
+editor. The settings block will be called `"gopls"` and contains a collection
+of controls for `gopls` that the editor is not expected to understand or
+control.
 
-In VSCode, this would be a section in your settings file that might look like this:
+In VSCode, this would be a section in your settings file that might look like
+this:
 
 ```json5
   "gopls": {
@@ -109,30 +136,22 @@
   },
 ```
 
-See [Settings](settings.md) for more information about the available configurations.
+See [Settings](settings.md) for more information about the available
+configurations.
 
 #### Workspace folder configuration
 
-This contains exactly the same set of values that are in the global configuration, but it is fetched for every workspace folder separately. The editor can choose to respond with different values per-folder.
-
-## Special Features
-
-### Symbol Queries
-
-Gopls supports some extended syntax for `workspace/symbol` requests, when using
-the `fuzzy` symbol matcher (the default). Inspired by the popular fuzzy matcher
-[FZF](https://github.com/junegunn/fzf), the following special characters are
-supported within symbol queries:
-
-| Character | Usage     | Match        |
-| --------- | --------- | ------------ |
-| `'`       | `'abc`    | exact        |
-| `^`       | `^printf` | exact prefix |
-| `$`       | `printf$` | exact suffix |
+This contains exactly the same set of values that are in the global
+configuration, but it is fetched for every workspace folder separately.
+The editor can choose to respond with different values per-folder.
 
 ### Working on the Go source distribution
 
-If you are working on the [Go project](https://go.googlesource.com/go) itself, your `go` command will have to correspond to the version of the source you are working on. That is, if you have downloaded the code to `$HOME/go`, your `go` command should be the `$HOME/go/bin/go` executable that you built with `make.bash` or equivalent.
+If you are working on the [Go project](https://go.googlesource.com/go) itself,
+your `go` command will have to correspond to the version of the source you are
+working on. That is, if you have downloaded the code 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. In VS Code, you can use the `go.alternateTools` setting to point to the correct version of `go`:
 
@@ -144,13 +163,3 @@
     }
 }
 ```
-
-## Command line support
-
-Much of the functionality of `gopls` is available through a command line interface.
-
-There are two main reasons for this. The first is that we do not want users to rely on separate command line tools when they wish to do some task outside of an editor. The second is that the CLI assists in debugging. It is easier to reproduce behavior via single command.
-
-It is not a goal of `gopls` to be a high performance command line tool. Its command line is intended for single file/package user interaction speeds, not bulk processing.
-
-For more information, see the `gopls` [command line page](command-line.md).
diff --git a/gopls/doc/vim.md b/gopls/doc/vim.md
index 63c1d58..41c01e9 100644
--- a/gopls/doc/vim.md
+++ b/gopls/doc/vim.md
@@ -18,7 +18,7 @@
 
 Use [vim-go] ver 1.20+, with the following configuration:
 
-```
+```vim
 let g:go_def_mode='gopls'
 let g:go_info_mode='gopls'
 ```
@@ -27,7 +27,7 @@
 
 Use [LanguageClient-neovim], with the following configuration:
 
-```
+```vim
 " Launch gopls when Go files are in use
 let g:LanguageClient_serverCommands = {
        \ 'go': ['gopls']
@@ -42,8 +42,8 @@
 
 ```vim
 let g:ale_linters = {
-	\ 'go': ['gopls'],
-	\}
+  \ 'go': ['gopls'],
+  \}
 ```
 
 see [this issue][ale-issue-2179]
diff --git a/gopls/doc/vscode.md b/gopls/doc/vscode.md
index 72be1ad..11f8efa 100644
--- a/gopls/doc/vscode.md
+++ b/gopls/doc/vscode.md
@@ -1,40 +1,26 @@
-# VSCode
+# VS Code
 
-Use the [VSCode-Go] plugin, with the following configuration:
+Use the [VS Code Go] plugin, with the following configuration:
 
 ```json5
 "go.useLanguageServer": true,
-"[go]": {
-    "editor.formatOnSave": true,
-    "editor.codeActionsOnSave": {
-        "source.organizeImports": true,
-    },
-    // Optional: Disable snippets, as they conflict with completion ranking.
-    "editor.snippetSuggestions": "none",
-},
-"[go.mod]": {
-    "editor.formatOnSave": true,
-    "editor.codeActionsOnSave": {
-        "source.organizeImports": true,
-    },
-},
+```
+
+As of February 2020, `gopls` will be enabled by default in [VS Code Go].
+To learn more, follow along with
+[golang.vscode-go#1037](https://github.com/golang/vscode-go/issues/1037).
+
+```json5
 "gopls": {
-     // Add parameter placeholders when completing a function.
-    "usePlaceholders": true,
+    // Add parameter placeholders when completing a function.
+    "ui.completion.usePlaceholders": true,
 
     // If true, enable additional analyses with staticcheck.
     // Warning: This will significantly increase memory usage.
-    "staticcheck": false,
-}
-```
-
-VSCode will complain about the `"gopls"` settings, but they will still work. Once we have a consistent set of settings, we will make the changes in the VSCode plugin necessary to remove the errors.
-
-If you encounter problems with import organization, please try setting a higher code action timeout (any value greater than 750ms), for example:
-
-```json5
-"[go]": {
-  "editor.codeActionsOnSaveTimeout": 3000
+    "ui.diagnostic.staticcheck": false,
+    
+    // For more customization, see
+    // see https://github.com/golang/vscode-go/blob/master/docs/settings.md.
 }
 ```
 
@@ -44,31 +30,37 @@
 "go.languageServerFlags": [
     "-rpc.trace", // for more detailed debug logging
     "serve",
-    "--debug=localhost:6060", // to investigate memory usage, see profiles
+    "--debug=localhost:6060", // Optional: investigate memory usage, see profiles
 ],
 ```
 
-See the section on [command line](command-line.md) arguments for more information about what these do, along with other things like `--logfile=auto` that you might want to use.
+See the section on [command line](command-line.md) arguments for more
+information about what these do, along with other things like
+`--logfile=auto` that you might want to use.
 
-You can disable features through the `"go.languageServerExperimentalFeatures"` section of the config. An example of a feature you may want to disable is `"documentLink"`, which opens [`pkg.go.dev`](https://pkg.go.dev) links when you click on import statements in your file.
+## Build tags and flags
 
-### Build tags
+Build tags and flags will be automatically picked up from `"go.buildTags"` and
+`"go.buildFlags"` settings. In the rare case that you don't want that default
+behavior, you can still override the settings from the `gopls` section, using
+`"gopls": { "build.buildFlags": [] }`.
 
-build tags will not be picked from `go.buildTags` configuration section, instead they should be specified as part of the`GOFLAGS` environment variable:
+## Remote Development with `gopls`
 
-```json5
-"go.toolsEnvVars": {
-    "GOFLAGS": "-tags=<yourtag>"
-}
-```
+You can also make use of `gopls` with the
+[VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview)
+extensions to enable full-featured Go development on a lightweight client
+machine, while connected to a more powerful server machine.
 
+First, install the Remote Development extension of your choice, such as the
+[Remote - SSH](https://code.visualstudio.com/docs/remote/ssh) extension. Once
+you open a remote session in a new window, open the Extensions pane
+(Ctrl+Shift+X) and you will see several different sections listed. In the
+"Local - Installed" section, navigate to the Go extension and click
+"Install in SSH: hostname".
 
-[VSCode-Go]: https://github.com/golang/vscode-go
+Once you have reloaded VS Code, you will be prompted to install `gopls` and other
+Go-related tools. After one more reload, you should be ready to develop remotely
+with VS Code and the Go extension.
 
-# VSCode Remote Development with gopls
-
-You can also make use of `gopls` with the [VSCode Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) extensions to enable full-featured Go development on a lightweight client machine, while connected to a more powerful server machine.
-
-First, install the Remote Development extension of your choice, such as the [Remote - SSH](https://code.visualstudio.com/docs/remote/ssh) extension. Once you open a remote session in a new window, open the Extensions pane (Ctrl+Shift+X) and you will see several different sections listed. In the "Local - Installed" section, navigate to the Go extension and click "Install in SSH: hostname".
-
-Once you have reloaded VSCode, you will be prompted to install `gopls` and other Go-related tools. After one more reload, you should be ready to develop remotely with VSCode and the Go extension.
+[VS Code Go]: https://github.com/golang/vscode-go
diff --git a/gopls/doc/workspace.md b/gopls/doc/workspace.md
new file mode 100644
index 0000000..6f56bf5
--- /dev/null
+++ b/gopls/doc/workspace.md
@@ -0,0 +1,75 @@
+# Setting up your workspace
+
+`gopls` supports both Go module and GOPATH modes. However, it needs a defined
+scope in which language features like references, rename, and implementation
+should operate.
+
+The following options are available for configuring this scope:
+
+## Module mode
+
+### One module
+
+If you are working with a single module, you can open the module root (the
+directory containing the `go.mod` file), a subdirectory within the module,
+or a parent directory containing the module.
+
+**Note**: If you open a parent directory containing a module, it must **only**
+contain that single module. Otherwise, you are working with multiple modules.
+
+### Multiple modules
+
+As of Jan 2020, if you are working with multiple modules, you will need to
+create a "workspace folder" for each module. This means that each module has
+its own scope, and features will not work across modules. We are currently
+working on addressing this limitation--see details about
+[experimental workspace module mode](#experimental-workspace-module-mode)
+below.
+
+In VS Code, you can create a workspace folder by setting up a
+[multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces).
+View the [documentation for your editor plugin](user.md#editor) to learn how to
+configure a workspace folder in your editor.
+
+#### Workspace module (experimental)
+
+Many `gopls` users would like to work with multiple modules at the same time
+([golang/go#32394](https://github.com/golang/go/issues/32394)), and
+specifically, have features that work across modules. We plan to add support
+for this via a concept called the "workspace module", which is described in
+[this design document](https://github.com/golang/proposal/blob/master/design/37720-gopls-workspaces.md).
+This feature works by creating a temporary module that requires all of your
+workspace modules, meaning all of their dependencies must be compatible.
+
+The workspace module feature is currently available as an opt-in experiment,
+and it will allow you to work with multiple modules without creating workspace
+folders for each module. You can try it out by configuring the
+[experimentalWorkspaceModule](settings.md#experimentalworkspacemodule-bool)
+setting. If you try it and encounter issues, please
+[report them](https://github.com/golang/go/issues/new) so we can address them
+before the feature is enabled by default.
+
+You can follow our progress on the workspace module work by looking at the
+open issues in the
+[gopls/workspace-module milestone](https://github.com/golang/go/milestone/179).
+
+### GOPATH mode
+
+When opening a directory within your GOPATH, the workspace scope will be just
+that directory.
+
+### At your own risk
+
+Some users or companies may have projects that encompass one `$GOPATH`. If you
+open your entire `$GOPATH` or `$GOPATH/src` folder, the workspace scope will be
+your entire `GOPATH`. If your GOPATH is large, `gopls` to be very slow to start
+because it will try to find all of the Go files in the directory you have
+opened. It will then load all of the files it has found.
+
+To work around this case, you can create a new `$GOPATH` that contains only the
+packages you want to work on.
+
+---
+
+If you have additional use cases that are not mentioned above, please
+[file a new issue](https://github.com/golang/go/issues/new).
diff --git a/gopls/go.mod b/gopls/go.mod
index fb835ea..7812cbc 100644
--- a/gopls/go.mod
+++ b/gopls/go.mod
@@ -7,9 +7,12 @@
 	github.com/sanity-io/litter v1.3.0
 	github.com/sergi/go-diff v1.1.0
 	golang.org/x/mod v0.4.0
-	golang.org/x/tools v0.0.0-20210112235408-75fd75db8797
+	golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
+	golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee
 	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
 	honnef.co/go/tools v0.0.1-2020.1.6
 	mvdan.cc/gofumpt v0.1.0
 	mvdan.cc/xurls/v2 v2.2.0
 )
+
+replace golang.org/x/tools => ../
diff --git a/gopls/go.sum b/gopls/go.sum
index 856de9d..5c8cfb0 100644
--- a/gopls/go.sum
+++ b/gopls/go.sum
@@ -31,7 +31,6 @@
 github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -41,26 +40,17 @@
 golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
 golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
-golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
-golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20210112235408-75fd75db8797 h1:kcvRujT1OsSzHGjvqsV0XWy92+z4TUgV2YwQH9aQt8I=
-golang.org/x/tools v0.0.0-20210112235408-75fd75db8797/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
diff --git a/gopls/integration/replay/main.go b/gopls/integration/replay/main.go
index 683ef81..35cd1d5 100644
--- a/gopls/integration/replay/main.go
+++ b/gopls/integration/replay/main.go
@@ -10,9 +10,9 @@
 	"context"
 	"flag"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"os"
-	"os/exec"
 	"sort"
 	"strconv"
 	"strings"
diff --git a/gopls/internal/hooks/licenses.go b/gopls/internal/hooks/licenses.go
index 48a37b4..028c90e 100644
--- a/gopls/internal/hooks/licenses.go
+++ b/gopls/internal/hooks/licenses.go
@@ -168,4 +168,4 @@
 
 `
 
-const licensesGeneratedFrom = "94aac0a277883c66ddf568b673882922962be4461ea544ca8ca246d867ff09df"
+const licensesGeneratedFrom = "029a0f934a7bad22a7d47185055bc554b1ea23ce427351caa87d9a088fcfba4e"
diff --git a/gopls/internal/regtest/expectation.go b/gopls/internal/regtest/expectation.go
index b518984..6c479c3 100644
--- a/gopls/internal/regtest/expectation.go
+++ b/gopls/internal/regtest/expectation.go
@@ -185,6 +185,27 @@
 	}
 }
 
+// DoneWithOpen expects all didOpen notifications currently sent by the editor
+// to be completely processed.
+func (e *Env) DoneWithOpen() Expectation {
+	opens := e.Editor.Stats().DidOpen
+	return CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidOpen), opens)
+}
+
+// DoneWithChange expects all didChange notifications currently sent by the
+// editor to be completely processed.
+func (e *Env) DoneWithChange() Expectation {
+	changes := e.Editor.Stats().DidChange
+	return CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidChange), changes)
+}
+
+// DoneWithChangeWatchedFiles expects all didChangeWatchedFiles notifications
+// currently sent by the editor to be completely processed.
+func (e *Env) DoneWithChangeWatchedFiles() Expectation {
+	changes := e.Editor.Stats().DidChangeWatchedFiles
+	return CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidChangeWatchedFiles), changes)
+}
+
 // CompletedWork expects a work item to have been completed >= atLeast times.
 //
 // Since the Progress API doesn't include any hidden metadata, we must use the
diff --git a/gopls/internal/regtest/reg_test.go b/gopls/internal/regtest/reg_test.go
index f8aae7f..25accb1 100644
--- a/gopls/internal/regtest/reg_test.go
+++ b/gopls/internal/regtest/reg_test.go
@@ -98,8 +98,8 @@
 		// Regtest cleanup is broken in go1.12 and earlier, and sometimes flakes on
 		// Windows due to file locking, but this is OK for our CI.
 		//
-		// Fail on non-windows go1.13+.
-		if testenv.Go1Point() >= 13 && runtime.GOOS != "windows" {
+		// Fail on go1.13+, except for windows and android which have shutdown problems.
+		if testenv.Go1Point() >= 13 && runtime.GOOS != "windows" && runtime.GOOS != "android" {
 			os.Exit(1)
 		}
 	}
diff --git a/gopls/internal/regtest/runner.go b/gopls/internal/regtest/runner.go
index d168d18..1e77cb8 100644
--- a/gopls/internal/regtest/runner.go
+++ b/gopls/internal/regtest/runner.go
@@ -8,11 +8,11 @@
 	"bytes"
 	"context"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"net"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime/pprof"
 	"strings"
diff --git a/gopls/internal/regtest/workspace_test.go b/gopls/internal/regtest/workspace_test.go
index 7e74b53..f4c21f7 100644
--- a/gopls/internal/regtest/workspace_test.go
+++ b/gopls/internal/regtest/workspace_test.go
@@ -449,7 +449,7 @@
 		// loaded. Validate this by jumping to a definition in b.com and ensuring
 		// that we go to the module cache.
 		env.OpenFile("moda/a/a.go")
-		env.Await(CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidOpen), 1))
+		env.Await(env.DoneWithOpen())
 
 		// To verify which modules are loaded, we'll jump to the definition of
 		// b.Hello.
@@ -479,11 +479,12 @@
 replace a.com => %s/moda/a
 replace b.com => %s/modb
 `, workdir, workdir))
-		env.Await(CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidChangeWatchedFiles), 1))
+		env.Await(env.DoneWithChangeWatchedFiles())
 		// Check that go.mod diagnostics picked up the newly active mod file.
 		// The local version of modb has an extra dependency we need to download.
 		env.OpenFile("modb/go.mod")
-		env.Await(CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidOpen), 2))
+		env.Await(env.DoneWithOpen())
+
 		var d protocol.PublishDiagnosticsParams
 		env.Await(
 			OnceMet(
@@ -501,7 +502,7 @@
 		// Now, let's modify the gopls.mod *overlay* (not on disk), and verify that
 		// this change is only picked up once it is saved.
 		env.OpenFile("gopls.mod")
-		env.Await(CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidOpen), 3))
+		env.Await(env.DoneWithOpen())
 		env.SetBufferContent("gopls.mod", fmt.Sprintf(`module gopls-workspace
 
 require (
@@ -514,7 +515,7 @@
 		// Editing the gopls.mod removes modb from the workspace modules, and so
 		// should clear outstanding diagnostics...
 		env.Await(OnceMet(
-			CompletedWork(lsp.DiagnosticWorkTitle(lsp.FromDidChange), 2),
+			env.DoneWithChange(),
 			EmptyDiagnostics("modb/go.mod"),
 		))
 		// ...but does not yet cause a workspace reload, so we should still jump to modb.
diff --git a/gopls/release/release.go b/gopls/release/release.go
index 62455fe..1739091 100644
--- a/gopls/release/release.go
+++ b/gopls/release/release.go
@@ -15,10 +15,10 @@
 	"flag"
 	"fmt"
 	"go/types"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"os/user"
 	"path/filepath"
 	"strconv"
diff --git a/internal/gocommand/invoke.go b/internal/gocommand/invoke.go
index f65aad4..8659a0c 100644
--- a/internal/gocommand/invoke.go
+++ b/internal/gocommand/invoke.go
@@ -9,9 +9,9 @@
 	"bytes"
 	"context"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"os"
-	"os/exec"
 	"regexp"
 	"strconv"
 	"strings"
diff --git a/internal/imports/mkstdlib.go b/internal/imports/mkstdlib.go
index 82d8f51..cf0fc49 100644
--- a/internal/imports/mkstdlib.go
+++ b/internal/imports/mkstdlib.go
@@ -14,11 +14,11 @@
 	"bytes"
 	"fmt"
 	"go/format"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"regexp"
 	"runtime"
diff --git a/internal/lsp/browser/browser.go b/internal/lsp/browser/browser.go
index 6867c85..0ac4f20 100644
--- a/internal/lsp/browser/browser.go
+++ b/internal/lsp/browser/browser.go
@@ -6,8 +6,8 @@
 package browser
 
 import (
+	exec "golang.org/x/sys/execabs"
 	"os"
-	"os/exec"
 	"runtime"
 	"time"
 )
diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go
index 16bef0b..ec35561 100644
--- a/internal/lsp/cache/view.go
+++ b/internal/lsp/cache/view.go
@@ -9,10 +9,10 @@
 	"context"
 	"encoding/json"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"os"
-	"os/exec"
 	"path"
 	"path/filepath"
 	"reflect"
diff --git a/internal/lsp/cmd/test/format.go b/internal/lsp/cmd/test/format.go
index f5b4631..77eedd4 100644
--- a/internal/lsp/cmd/test/format.go
+++ b/internal/lsp/cmd/test/format.go
@@ -6,9 +6,9 @@
 
 import (
 	"bytes"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"os"
-	"os/exec"
 	"regexp"
 	"strings"
 	"testing"
diff --git a/internal/lsp/fake/editor.go b/internal/lsp/fake/editor.go
index a5fbf2b..758b64b 100644
--- a/internal/lsp/fake/editor.go
+++ b/internal/lsp/fake/editor.go
@@ -41,6 +41,14 @@
 	buffers map[string]buffer
 	// Capabilities / Options
 	serverCapabilities protocol.ServerCapabilities
+	// Call metrics for the purpose of expectations. This is done in an ad-hoc
+	// manner for now. Perhaps in the future we should do something more
+	// systematic.
+	calls CallCounts
+}
+
+type CallCounts struct {
+	DidOpen, DidChange, DidChangeWatchedFiles int
 }
 
 type buffer struct {
@@ -131,6 +139,12 @@
 	return e, nil
 }
 
+func (e *Editor) Stats() CallCounts {
+	e.mu.Lock()
+	defer e.mu.Unlock()
+	return e.calls
+}
+
 // Shutdown issues the 'shutdown' LSP notification.
 func (e *Editor) Shutdown(ctx context.Context) error {
 	if e.Server != nil {
@@ -282,6 +296,7 @@
 		return
 	}
 	e.mu.Lock()
+	defer e.mu.Unlock()
 	var lspevts []protocol.FileEvent
 	for _, evt := range evts {
 		// Always send an on-disk change, even for events that seem useless
@@ -302,10 +317,10 @@
 			_ = e.setBufferContentLocked(ctx, evt.Path, false, strings.Split(content, "\n"), nil)
 		}
 	}
-	e.mu.Unlock()
 	e.Server.DidChangeWatchedFiles(ctx, &protocol.DidChangeWatchedFilesParams{
 		Changes: lspevts,
 	})
+	e.calls.DidChangeWatchedFiles++
 }
 
 // OpenFile creates a buffer for the given workdir-relative file.
@@ -346,9 +361,9 @@
 		dirty:   dirty,
 	}
 	e.mu.Lock()
+	defer e.mu.Unlock()
 	e.buffers[path] = buf
 	item := textDocumentItem(e.sandbox.Workdir, buf)
-	e.mu.Unlock()
 
 	if e.Server != nil {
 		if err := e.Server.DidOpen(ctx, &protocol.DidOpenTextDocumentParams{
@@ -356,6 +371,7 @@
 		}); err != nil {
 			return errors.Errorf("DidOpen: %w", err)
 		}
+		e.calls.DidOpen++
 	}
 	return nil
 }
@@ -570,6 +586,14 @@
 	return e.setBufferContentLocked(ctx, path, true, lines, nil)
 }
 
+// HasBuffer reports whether the file name is open in the editor.
+func (e *Editor) HasBuffer(name string) bool {
+	e.mu.Lock()
+	defer e.mu.Unlock()
+	_, ok := e.buffers[name]
+	return ok
+}
+
 // BufferText returns the content of the buffer with the given name.
 func (e *Editor) BufferText(name string) string {
 	e.mu.Lock()
@@ -629,6 +653,7 @@
 		if err := e.Server.DidChange(ctx, params); err != nil {
 			return errors.Errorf("DidChange: %w", err)
 		}
+		e.calls.DidChange++
 	}
 	return nil
 }
@@ -652,8 +677,10 @@
 	}
 	newPath := e.sandbox.Workdir.URIToPath(resp[0].URI)
 	newPos := fromProtocolPosition(resp[0].Range.Start)
-	if err := e.OpenFile(ctx, newPath); err != nil {
-		return "", Pos{}, errors.Errorf("OpenFile: %w", err)
+	if !e.HasBuffer(newPath) {
+		if err := e.OpenFile(ctx, newPath); err != nil {
+			return "", Pos{}, errors.Errorf("OpenFile: %w", err)
+		}
 	}
 	return newPath, newPos, nil
 }
diff --git a/internal/lsp/lsprpc/autostart_default.go b/internal/lsp/lsprpc/autostart_default.go
index 2ddc5b6..dc04f66 100644
--- a/internal/lsp/lsprpc/autostart_default.go
+++ b/internal/lsp/lsprpc/autostart_default.go
@@ -5,7 +5,7 @@
 package lsprpc
 
 import (
-	"os/exec"
+	exec "golang.org/x/sys/execabs"
 
 	errors "golang.org/x/xerrors"
 )
diff --git a/internal/lsp/lsprpc/autostart_posix.go b/internal/lsp/lsprpc/autostart_posix.go
index d6c832b..9ad3f1d 100644
--- a/internal/lsp/lsprpc/autostart_posix.go
+++ b/internal/lsp/lsprpc/autostart_posix.go
@@ -10,9 +10,9 @@
 	"crypto/sha256"
 	"errors"
 	"fmt"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"os"
-	"os/exec"
 	"os/user"
 	"path/filepath"
 	"strconv"
diff --git a/internal/lsp/source/rename_check.go b/internal/lsp/source/rename_check.go
index 042331c..7986ea1 100644
--- a/internal/lsp/source/rename_check.go
+++ b/internal/lsp/source/rename_check.go
@@ -894,6 +894,9 @@
 }
 
 func objectKind(obj types.Object) string {
+	if obj == nil {
+		return "nil object"
+	}
 	switch obj := obj.(type) {
 	case *types.PkgName:
 		return "imported package name"
@@ -937,6 +940,9 @@
 }
 
 func isPackageLevel(obj types.Object) bool {
+	if obj == nil {
+		return false
+	}
 	return obj.Pkg().Scope().Lookup(obj.Name()) == obj
 }
 
diff --git a/internal/lsp/tests/README.md b/internal/lsp/tests/README.md
index 31268a9..d8ba10f 100644
--- a/internal/lsp/tests/README.md
+++ b/internal/lsp/tests/README.md
@@ -1,9 +1,9 @@
-## Testing
+# Testing
 
 LSP has "marker tests" defined in `internal/lsp/testdata`, as well as
 traditional tests.
 
-#### Marker tests
+## Marker tests
 
 Marker tests have a standard input file, like
 `internal/lsp/testdata/foo/bar.go`, and some may have a corresponding golden
@@ -18,17 +18,17 @@
 When tests are run, each annotation results in a new subtest, which is encoded
 in the golden file with a heading like,
 
-```
+```bash
 -- suggestedfix_bar_11_21 --
 // expected contents go here
 -- suggestedfix_bar_13_20 --
 // expected contents go here
 ```
 
-The format of these headings vary: they are defined by the "Golden" function for
-each annotation: https://pkg.go.dev/golang.org/x/tools/internal/lsp/tests#Data.Golden.
-In the case above, the format is: annotation name, file name, annotation line
-location, annotation character location.
+The format of these headings vary: they are defined by the
+[`Golden`](https://pkg.go.dev/golang.org/x/tools/internal/lsp/tests#Data.Golden)
+function for each annotation. In the case above, the format is: annotation
+name, file name, annotation line location, annotation character location.
 
 So, if `internal/lsp/testdata/foo/bar.go` has three `suggestedfix` annotations,
 the golden file should have three headers with `suggestedfix_bar_xx_yy`
@@ -39,7 +39,7 @@
 
 To run marker tests,
 
-```
+```bash
 cd /path/to/tools
 
 # The marker tests are located in "internal/lsp", "internal/lsp/cmd, and
@@ -50,17 +50,17 @@
 There are quite a lot of marker tests, so to run one individually, pass the test
 path and heading into a -run argument:
 
-```
+```bash
 cd /path/to/tools
 go test ./internal/lsp -v -run TestLSP/Modules/SuggestedFix/bar_11_21
 ```
 
-#### Resetting marker tests
+## Resetting marker tests
 
 Sometimes, a change is made to lsp that requires a change to multiple golden
 files. When this happens, you can run,
 
-```
+```bash
 cd /path/to/tools
 ./internal/lsp/reset_golden.sh
-```
\ No newline at end of file
+```
diff --git a/internal/testenv/testenv.go b/internal/testenv/testenv.go
index f725b95..65b7953 100644
--- a/internal/testenv/testenv.go
+++ b/internal/testenv/testenv.go
@@ -10,9 +10,9 @@
 	"bytes"
 	"fmt"
 	"go/build"
+	exec "golang.org/x/sys/execabs"
 	"io/ioutil"
 	"os"
-	"os/exec"
 	"runtime"
 	"strings"
 	"sync"
diff --git a/playground/socket/socket.go b/playground/socket/socket.go
index 17b6de3..5e385eb 100644
--- a/playground/socket/socket.go
+++ b/playground/socket/socket.go
@@ -19,6 +19,7 @@
 	"errors"
 	"go/parser"
 	"go/token"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
@@ -26,7 +27,6 @@
 	"net/http"
 	"net/url"
 	"os"
-	"os/exec"
 	"path/filepath"
 	"runtime"
 	"strings"
diff --git a/refactor/rename/mvpkg.go b/refactor/rename/mvpkg.go
index 7889711..58fad6b 100644
--- a/refactor/rename/mvpkg.go
+++ b/refactor/rename/mvpkg.go
@@ -18,9 +18,9 @@
 	"go/build"
 	"go/format"
 	"go/token"
+	exec "golang.org/x/sys/execabs"
 	"log"
 	"os"
-	"os/exec"
 	"path"
 	"path/filepath"
 	"regexp"
diff --git a/refactor/rename/rename.go b/refactor/rename/rename.go
index 3651c62..e74e0a6 100644
--- a/refactor/rename/rename.go
+++ b/refactor/rename/rename.go
@@ -17,11 +17,11 @@
 	"go/parser"
 	"go/token"
 	"go/types"
+	exec "golang.org/x/sys/execabs"
 	"io"
 	"io/ioutil"
 	"log"
 	"os"
-	"os/exec"
 	"path"
 	"regexp"
 	"sort"