internal/lsp/cache: include missing dependencies in mod tidy key

(source.Package).Imports only returns successful imports, but go mod
tidy looks at all of them, so we need to include MissingDependencies in
the key too.

Change-Id: I790fd8d3cfd8e85be18a435698954e55611cfd8c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/274240
Trust: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/cache/mod_tidy.go b/internal/lsp/cache/mod_tidy.go
index e77a8c3..7e8d567 100644
--- a/internal/lsp/cache/mod_tidy.go
+++ b/internal/lsp/cache/mod_tidy.go
@@ -204,6 +204,7 @@
 				imports = append(imports, imp)
 			}
 		}
+		imports = append(imports, pkg.MissingDependencies()...)
 	}
 	sort.Strings(imports)
 	hashed := strings.Join(imports, ",")