diff --git a/gopls/internal/golang/completion/completion.go b/gopls/internal/golang/completion/completion.go
index f6d2277..d3fca7f 100644
--- a/gopls/internal/golang/completion/completion.go
+++ b/gopls/internal/golang/completion/completion.go
@@ -1922,6 +1922,11 @@
if ignoreUnimportedCompletion(&pkg) {
return
}
+ // Skip standard library module paths (e.g., "std/maps") since they are
+ // duplicates of stdlib packages. See golang/go#75310.
+ if strings.HasPrefix(pkg.StmtInfo.ImportPath, "std/") {
+ return
+ }
mu.Lock()
defer mu.Unlock()
if _, ok := seen[pkg.IdentName]; ok {
diff --git a/gopls/internal/golang/completion/unimported.go b/gopls/internal/golang/completion/unimported.go
index 53350ef..85576de 100644
--- a/gopls/internal/golang/completion/unimported.go
+++ b/gopls/internal/golang/completion/unimported.go
@@ -311,6 +311,12 @@
got := make([]CompletionItem, 0, lx)
pattern := strings.ToLower(prefix)
for _, cand := range cands {
+ // Skip standard library module paths (e.g., "std/maps") since they are
+ // duplicates of packages already handled by stdlibMatches.
+ // See golang/go#75310.
+ if strings.HasPrefix(cand.ImportPath, "std/") {
+ continue
+ }
if !usefulCompletion(cand.Name, pattern) {
continue
}