Random nit on math/rand/v2 autocomplete

How can I get autocomplete to use the new math/rand/v2 package? It suggests rand.Intn instead of rand.IntN. I’ll update the text a few times and it’ll start suggesting the new functions, but it seems that when I start up again it’s gone back to the old package.

Using GoLand and v7.69.1-nightly of the plugin.

I believe that Cody’s autocomplete is trained (the underlaying base LLM model for autocomplete) on the older package, that’s why it by default suggests incorrect/old package variant.

Probably when you update the text and/or there are other code with the newest package variant then autocomplete learns from the code context and adapts to the new style. But when you restart IDE/start up again then this recent code context is lost.

1 Like