diff options
author | Russ Cox <rsc@golang.org> | 2022-04-11 22:38:20 -0400 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2022-04-12 17:41:31 +0000 |
commit | 2bbdb7a52e8502258c88e85da69c13d4e3d6f10f (patch) | |
tree | 4d9c63f610feb654324e1a6f2c4d381245df191d /internal/lsp/cache/parse.go | |
parent | 5fef6fdaed6f1d9428caf7126087ec67105ab1df (diff) | |
download | golang-x-tools-2bbdb7a52e8502258c88e85da69c13d4e3d6f10f.tar.gz |
gopls, internal/lsp: gofmt
Gofmt to update doc comments to the new formatting.
(There are so many files in x/tools I am breaking up the
gofmt'ing into multiple CLs.)
For golang/go#51082.
Change-Id: Ife11502fe1e59a04d53dba9edccd3043e57f9ae8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/399358
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'internal/lsp/cache/parse.go')
-rw-r--r-- | internal/lsp/cache/parse.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/internal/lsp/cache/parse.go b/internal/lsp/cache/parse.go index e761373fa..3e86cd5e7 100644 --- a/internal/lsp/cache/parse.go +++ b/internal/lsp/cache/parse.go @@ -778,11 +778,11 @@ func fixSrc(f *ast.File, tok *token.File, src []byte) (newSrc []byte) { // fixMissingCurlies adds in curly braces for block statements that // are missing curly braces. For example: // -// if foo +// if foo // // becomes // -// if foo {} +// if foo {} func fixMissingCurlies(f *ast.File, b *ast.BlockStmt, parent ast.Node, tok *token.File, src []byte) []byte { // If the "{" is already in the source code, there isn't anything to // fix since we aren't missing curlies. @@ -875,23 +875,22 @@ func fixMissingCurlies(f *ast.File, b *ast.BlockStmt, parent ast.Node, tok *toke // "case" and "default" keywords as inside the switch statement. For // example: // -// switch { -// def<> -// } +// switch { +// def<> +// } // // gets parsed like: // -// switch { -// } +// switch { +// } // // Later we manually pull out the "def" token, but we need to detect // that our "<>" position is inside the switch block. To do that we // move the curly brace so it looks like: // -// switch { -// -// } +// switch { // +// } func fixEmptySwitch(body *ast.BlockStmt, tok *token.File, src []byte) { // We only care about empty switch statements. if len(body.List) > 0 || !body.Rbrace.IsValid() { @@ -921,9 +920,10 @@ func fixEmptySwitch(body *ast.BlockStmt, tok *token.File, src []byte) { // fixDanglingSelector inserts real "_" selector expressions in place // of phantom "_" selectors. For example: // -// func _() { -// x.<> -// } +// func _() { +// x.<> +// } +// // var x struct { i int } // // To fix completion at "<>", we insert a real "_" after the "." so the |