gopls/internal/lsp/source: simplify legacy 'references' func

The function used to accept three booleans, the middle of which
was always false. By simplifying under that invariant, the
other two booleans fall away, along with the 'implementations'
query that it used to make.

Small steps...

Change-Id: Ib520661b822afd85d6f0311253779a6202afd33d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/463687
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/gopls/internal/lsp/source/rename.go b/gopls/internal/lsp/source/rename.go
index 385dff4..ca3c694 100644
--- a/gopls/internal/lsp/source/rename.go
+++ b/gopls/internal/lsp/source/rename.go
@@ -548,6 +548,17 @@
 					try++
 					localName = fmt.Sprintf("%s%d", newName, try)
 				}
+
+				// renameObj detects various conflicts, including:
+				// - new name conflicts with a package-level decl in this file;
+				// - new name hides a package-level decl in another file that
+				//   is actually referenced in this file;
+				// - new name hides a built-in that is actually referenced
+				//   in this file;
+				// - a reference in this file to the old package name would
+				//   become shadowed by an intervening declaration that
+				//   uses the new name.
+				// It returns the edits if no conflict was detected.
 				changes, err := renameObj(ctx, snapshot, localName, qos)
 				if err != nil {
 					return err
@@ -587,7 +598,7 @@
 	if !isValidIdentifier(newName) {
 		return nil, fmt.Errorf("invalid identifier to rename: %q", newName)
 	}
-	refs, err := references(ctx, s, qos, true, false, true)
+	refs, err := references(ctx, s, qos)
 	if err != nil {
 		return nil, err
 	}