Refactor/F2 is not working

When I want to rename class and method names (pressing F2) Cursor do the weirdest thing ever: it renames all the files with dependency but refusing to rename the main file I am working in.