Skip to content

Commit 31b9a74

Browse files
committed
internal/lsp/cache: handle missing mod file
If the config changes in non-module mode, don't look at the nonexistant mod file. I actually caught this case after review but didn't finish the job. Fixes golang/go#40121. Change-Id: Ic888f7eab5f882e6ca79b046b5a3fb37b3b19e5c Reviewed-on: https://go-review.googlesource.com/c/tools/+/241520 Run-TryBot: Heschi Kreinick <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 7370b03 commit 31b9a74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/lsp/cache/view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ func (v *View) RunProcessEnvFunc(ctx context.Context, fn func(*imports.Options)
407407
}
408408
v.cleanupProcessEnv()
409409
}
410-
v.cachedModFileIdentifier = modFH.Identity().Identifier
410+
v.cachedModFileIdentifier = modFileIdentifier
411411
v.cachedBuildFlags = currentBuildFlags
412412
v.cleanupProcessEnv, err = v.populateProcessEnv(ctx, modFH, sumFH)
413413
if err != nil {

0 commit comments

Comments
 (0)