Handling context for autocomplete during long sessions

Along the lines of Srini-B’s questions about multiple chats. Separating them, starting new ones, that helps contain the context?

What’s the a recommended approach for autocomplete? The context is selected automagically for these right? What do you do when the autocomplete starts hallucinating, suggesting things that made sense before that last refactor, for example? Restart the IDE? Close tabs?

I use Jetbrains IDEs, if that matters for the answer.