Skip to content

Commit c5308ae

Browse files
committed
all: merge master (81c7dc4) into gopls-release-branch.0.9
Also add a replace to gopls/go.mod. For golang/go#54294 Conflicts: - gopls/go.mod - gopls/go.sum Merge List: + 2022-08-04 81c7dc4 internal/lsp: polish vulncheck progress messages + 2022-08-04 af2a0a8 internal/lsp: use exec.CommandContext when running vulncheck + 2022-08-04 3519aa2 internal/lsp/cmd: remove unused Env from pkgLoadConfig + 2022-08-04 6c27717 internal/lsp/mod/code_lens: add "run govulncheck" codelens + 2022-08-04 763f65c gopls/internal/regtest/misc: simplify shared edit tests + 2022-08-04 fc3b24a go/internal/gcimporter: rewrite interface receiver parameters + 2022-08-04 b5fd088 internal/lsp/command: replace VulncheckArgs Dir with URI + 2022-08-04 99fd76f internal/lsp/cache: delete KnownMetadata.PkgFilesChanged + 2022-08-04 01c9ff0 internal/lsp/cache: invalid packages should not be workspace packages + 2022-08-04 bd68922 internal/lsp: new options to disable certain kinds of semantic tokens + 2022-08-04 bceee4b internal/lsp/command: let RunVulncheckExp call gopls vulncheck + 2022-08-04 3e0a503 internal/lsp: use directoryFilters in import scanning + 2022-08-04 87f47bb gopls/internal/regtest/bench: refactor and improve benchmarks + 2022-08-03 8b9a1fb go/callgraph/vta: do not assume that recovers cannot be deferred + 2022-08-03 371fc67 go/tools: add check for time formats with 2006-02-01 + 2022-08-03 d08f5dc gopls/internal/regtest: unskip all of TestModFileModification + 2022-08-03 ddb90ec internal/lsp/cache: fix data races to view.options + 2022-08-02 0d04f65 internal/lsp: re-send diagnostics on file events + 2022-08-02 d025cce internal/lsp/source: don't crash requesting gc_details for an empty file + 2022-08-02 10cb435 internal/lsp/regtest: improvements for shared execution modes + 2022-08-02 4d0b383 internal/lsp/regtest: minor cleanup for magic regtest envvar + 2022-08-02 310ea71 gopls/internal/regtest: add a test that ignoring a file resolves errors + 2022-08-01 21861e6 gopls/internal/regtest/bench: put feature benchmarks in their own file + 2022-08-01 c7f1191 go/internal/gcimporter: set underlying types in proper order; flatten imports + 2022-08-01 bd3f524 internal/lsp: rename all the package names in the renamed package + 2022-08-01 9f65685 internal/lsp/source: enable the new diff with allExperiments + 2022-07-29 9580c84 internal/lsp: Check if user's editor support rename operation + 2022-07-29 f560bc8 internal/lsp/cache: don't set context cancellation as a critical err + 2022-07-28 8ea5687 internal/lsp/regtest: remove arbitrary timeout for closing the editor + 2022-07-28 d01bb2f internal/lsp/source: document the handling of GOPRIVATE for linkTarget + 2022-07-28 98bfcd1 internal/memoize: fix race in Store.Promise + 2022-07-27 e02e98a internal/lsp/cache: allow network whenever reloading the workspace + 2022-07-27 b52794a internal/lsp/cache: simplify snapshot.Clone reinitialization logic + 2022-07-27 f1bb5ca internal/lsp/cache: report a critical error when go.work is invalid + 2022-07-27 b3b5c13 internal/lsp/cache: invalidate packages with missing deps when files are added + 2022-07-26 39a4e36 internal/lsp/regtest: only run /default tests with -short + 2022-07-26 f157068 internal/lsp/regtest: allow sharing memoized results across regtests + 2022-07-26 8ccb25c internal/lsp: treat struct tags as string type + 2022-07-26 6c8a6c4 internal/lsp: suppress parameter hint when argument matches parameter + 2022-07-26 c83f42d internal/lsp: update inlay hints documentation to include go snippets + 2022-07-26 8b47d4e all: update dependencies + 2022-07-26 7600454 gopls: update dependencies + 2022-07-25 2a6393f internal/lsp: Refactor to share logic with rename + 2022-07-25 4375b29 cmd/auth/cookieauth: delete unreachable os.Exit + 2022-07-25 005c07a gopls/internal/vulncheck: adjust logging + 2022-07-25 04bd087 internal/lsp: enable fillstruct for generics + 2022-07-25 6ec939a internal/span: fix incorrect bounds check in ToOffset + 2022-07-25 178fdf9 gopls/internal/regtest: unskip Test_Issue38211 + 2022-07-25 1cfe623 gopls/internal/regtest: unskip TestQuickFixEmptyFiles + 2022-07-24 3d474c8 internal/lsp/diff: new diff implementation to replace go-diff + 2022-07-22 a2a2477 gopls/internal/regtest: externalize shouldLoad tracking + 2022-07-22 7b605f4 gopls/internal/vulncheck: pass go version to vulncheck config + 2022-07-22 126ef8f gopls/internal/govulncheck: sync x/vuln@b9a3ad9 + 2022-07-22 a732e45 gopls: update golang.org/x/vuln + 2022-07-22 980cbfe A+C: delete AUTHORS and CONTRIBUTORS + 2022-07-20 ec1f924 internal/lsp: add check for nil results to fillreturns + 2022-07-19 79f3242 godoc: support go1.19 doc comment syntax + 2022-07-18 2957e9d go/callgraph/vta: use types.IsInterface instead of our own isInterface + 2022-07-18 2eaea86 go/callgraph/vta: do not include interface types during propagation + 2022-07-18 dc45e74 internal/lsp: Update FilterDisallow to support matching directories at arbitrary depth. + 2022-07-15 ce6ce76 internal/lsp/regtest: increase the time allowed for shutdown + 2022-07-15 32129bf go/internal/gcimporter: adjust importer to match compiler importer + 2022-07-15 22d1494 internal/gcimporter: add support for reading unified IR export data + 2022-07-15 c3af7c2 internal/lsp/cache: delete workspacePackageHandles (dead code) + 2022-07-15 1a4e02f internal/lsp/analysis/unusedvariable: add analyzer + 2022-07-14 db8f89b internal/memoize: rename Handle to Promise + 2022-07-13 a7c53b5 internal/analysisinternal: move FindBestMatch to internal/lsp/fuzzy + 2022-07-13 9b6c018 internal/lsp/cache: don't trim unexported struct fields + 2022-07-13 85173cc internal/lsp/cache: follow usual structure for packages, analysis maps + 2022-07-13 b2eae76 internal/lsp/cache: simplify modwhy cache + 2022-07-13 dcb576d internal/lsp/cache: simplify modtidy + 2022-07-13 b230791 internal/lsp/cache: move PosTo{Decl,Field} out of cache + 2022-07-12 8730184 internal/lsp/fake: retry spurious file lock errors on windows + 2022-07-12 459e2b8 internal/lsp/progress: actually close over Context in WorkDoneWriter + 2022-07-12 7c06b01 go/callgraph/vta: remove interprocedural flows for receiver objects + 2022-07-12 6e6f313 internal/lsp/regtest: simplify, consolidate, and document settings + 2022-07-12 3db2cdc internal/lsp: wait for ongoing work to complete during server shutdown + 2022-07-12 a5adb0f internal/lsp/cache: use mod=readonly for process env funcs + 2022-07-12 a79ee0f Revert "Revert "internal/lsp/cache: don't pin a snapshot to view.importsState" + 2022-07-12 bc957ec internal/lsp/source: use token.File-agnostic positions to dedupe refs + 2022-07-11 b6e4951 Revert "internal/lsp/cache: don't pin a snapshot to view.importsState" + 2022-07-11 71dc5e2 internal/lsp/cache: make snapshot reference counting uniform + 2022-07-11 42457a5 internal/lsp/cache: don't pin a snapshot to view.importsState + 2022-07-08 d6c099e internal/memoize: document stateIdle, RefCounted + 2022-07-08 53ead67 internal/memoize: delete Generation and Bind + 2022-07-08 8746177 internal/lsp/cache: simplify ParseGo + 2022-07-08 9c2a556 internal/lsp/cache: fail addPackageHandle if metadata is stale + 2022-07-07 1dfab61 internal/lsp/cache: use GetHandle not Bind for 5 URI-keyed maps + 2022-07-07 2aef121 internal/lsp: consolidate .go/go.mod link logic + 2022-07-07 8184d1f internal/lsp/cache: use GetHandle not Bind in astCacheData + 2022-07-06 36430f4 internal/lsp/cache: use GetHandle not Bind for actions + 2022-07-06 b929f3b internal/span: make NewRange accept File, not FileSet + 2022-07-06 d69bac6 internal/lsp/cache: cache isActiveLocked calculation across snapshots + 2022-07-05 afa4a95 internal/lsp/cache: persist known subdirs + 2022-07-01 698251a internal/lsp/cache: sort Metadata.Deps, for determinism + 2022-07-01 f79f3aa internal/lsp/cache: clarify buildPackageHandle + 2022-07-01 e92a18f internal/lsp/lsppos: reduce allocations in NewMapper + 2022-07-01 f487f36 internal/lsp/source: reduce allocation in workspace-symbols + 2022-07-01 7b04e8b internal/persistent: no-op deletion from map does not allocate + 2022-07-01 f042799 internal/memoize: delete Bind(cleanup) hook + 2022-07-01 bec0cf1 internal/lsp/cache: avoid Handle mechanism for workspace dir + 2022-07-01 ffc70b9 lsp/completion: fix ranking of *types.PkgName candidates + 2022-07-01 93bf1fc gopls: add range over channel postfix completion + 2022-07-01 79fefdf internal/memoize: do not iterate all handles on generation destruction + 2022-07-01 fa4babc internal/lsp/cache: use persistent map for storing packages in the snapshot Change-Id: If2b0e078a3d689617090269ad9ba26edeafaa62c
2 parents 6787ae7 + 81c7dc4 commit c5308ae

File tree

298 files changed

+11000
-4660
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+11000
-4660
lines changed

AUTHORS

Lines changed: 0 additions & 3 deletions
This file was deleted.

CONTRIBUTORS

Lines changed: 0 additions & 3 deletions
This file was deleted.

cmd/auth/cookieauth/cookieauth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func main() {
4040
f, err := os.Open(os.Args[1])
4141
if err != nil {
4242
log.Fatalf("failed to read cookie file: %v\n", os.Args[1])
43-
os.Exit(1)
4443
}
4544
defer f.Close()
4645

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module golang.org/x/tools
22

3-
go 1.17
3+
go 1.18
44

55
require (
6-
github.com/yuin/goldmark v1.4.1
6+
github.com/yuin/goldmark v1.4.13
77
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
8-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f
9-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
10-
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654
8+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
9+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
10+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
1111
golang.org/x/text v0.3.7
1212
)

go.sum

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
2-
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
1+
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
2+
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
33
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
44
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
55
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
66
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
77
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
88
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
9-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
10-
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
9+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
10+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
1111
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
12-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
13-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
12+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
13+
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
1414
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
1515
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
16-
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1716
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18-
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0=
19-
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
17+
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
19+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2020
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
21-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
22-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
21+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
2322
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
2423
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
25-
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
2624
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
2725
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
2826
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

go/analysis/analysistest/analysistest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func RunWithSuggestedFixes(t Testing, dir string, a *analysis.Analyzer, patterns
142142
}
143143
fileContents[file] = contents
144144
}
145-
spn, err := span.NewRange(act.Pass.Fset, edit.Pos, edit.End).Span()
145+
spn, err := span.NewRange(file, edit.Pos, edit.End).Span()
146146
if err != nil {
147147
t.Errorf("error converting edit to span %s: %v", file.Name(), err)
148148
}

go/analysis/passes/tests/tests.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,12 @@ func checkTest(pass *analysis.Pass, fn *ast.FuncDecl, prefix string) {
475475
if tparams := typeparams.ForFuncType(fn.Type); tparams != nil && len(tparams.List) > 0 {
476476
// Note: cmd/go/internal/load also errors about TestXXX and BenchmarkXXX functions with type parameters.
477477
// We have currently decided to also warn before compilation/package loading. This can help users in IDEs.
478+
// TODO(adonovan): use ReportRangef(tparams).
478479
pass.Reportf(fn.Pos(), "%s has type parameters: it will not be run by go test as a %sXXX function", fn.Name.Name, prefix)
479480
}
480481

481482
if !isTestSuffix(fn.Name.Name[len(prefix):]) {
483+
// TODO(adonovan): use ReportRangef(fn.Name).
482484
pass.Reportf(fn.Pos(), "%s has malformed name: first letter after '%s' must not be lowercase", fn.Name.Name, prefix)
483485
}
484486
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2022 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// This file contains tests for the timeformat checker.
6+
7+
package a
8+
9+
import (
10+
"time"
11+
12+
"b"
13+
)
14+
15+
func hasError() {
16+
a, _ := time.Parse("2006-02-01 15:04:05", "2021-01-01 00:00:00") // want `2006-02-01 should be 2006-01-02`
17+
a.Format(`2006-02-01`) // want `2006-02-01 should be 2006-01-02`
18+
a.Format("2006-02-01 15:04:05") // want `2006-02-01 should be 2006-01-02`
19+
20+
const c = "2006-02-01"
21+
a.Format(c) // want `2006-02-01 should be 2006-01-02`
22+
}
23+
24+
func notHasError() {
25+
a, _ := time.Parse("2006-01-02 15:04:05", "2021-01-01 00:00:00")
26+
a.Format("2006-01-02")
27+
28+
const c = "2006-01-02"
29+
a.Format(c)
30+
31+
v := "2006-02-01"
32+
a.Format(v) // Allowed though variables.
33+
34+
m := map[string]string{
35+
"y": "2006-02-01",
36+
}
37+
a.Format(m["y"])
38+
39+
s := []string{"2006-02-01"}
40+
a.Format(s[0])
41+
42+
a.Format(badFormat())
43+
44+
o := b.Parse("2006-02-01 15:04:05", "2021-01-01 00:00:00")
45+
o.Format("2006-02-01")
46+
}
47+
48+
func badFormat() string {
49+
return "2006-02-01"
50+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2022 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// This file contains tests for the timeformat checker.
6+
7+
package a
8+
9+
import (
10+
"time"
11+
12+
"b"
13+
)
14+
15+
func hasError() {
16+
a, _ := time.Parse("2006-01-02 15:04:05", "2021-01-01 00:00:00") // want `2006-02-01 should be 2006-01-02`
17+
a.Format(`2006-01-02`) // want `2006-02-01 should be 2006-01-02`
18+
a.Format("2006-01-02 15:04:05") // want `2006-02-01 should be 2006-01-02`
19+
20+
const c = "2006-02-01"
21+
a.Format(c) // want `2006-02-01 should be 2006-01-02`
22+
}
23+
24+
func notHasError() {
25+
a, _ := time.Parse("2006-01-02 15:04:05", "2021-01-01 00:00:00")
26+
a.Format("2006-01-02")
27+
28+
const c = "2006-01-02"
29+
a.Format(c)
30+
31+
v := "2006-02-01"
32+
a.Format(v) // Allowed though variables.
33+
34+
m := map[string]string{
35+
"y": "2006-02-01",
36+
}
37+
a.Format(m["y"])
38+
39+
s := []string{"2006-02-01"}
40+
a.Format(s[0])
41+
42+
a.Format(badFormat())
43+
44+
o := b.Parse("2006-02-01 15:04:05", "2021-01-01 00:00:00")
45+
o.Format("2006-02-01")
46+
}
47+
48+
func badFormat() string {
49+
return "2006-02-01"
50+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package b
2+
3+
type B struct {
4+
}
5+
6+
func Parse(string, string) B {
7+
return B{}
8+
}
9+
10+
func (b B) Format(string) {
11+
}

0 commit comments

Comments
 (0)