I just had a similar issue where Netbeans stopped autocompleting within a specific project (other projects were working fine). I am running Netbeans 7.2.1 on Windows 7. I am also using namespaces and use statements. When trying to use autocomplete, Netbeans was just giving me variable names declared in the same method. Using the this keyword within a class wouldn't even give me variables/methods in that class.
Here is what I did to fix it:
- Went to the "Project" window and right clicked on my project and hit close
- Closed Netbeans
- Deleted Netbeans' cache. This can be found at C:\Users\ProfileName\AppData\Local\NetBeans\Cache\7.2.1 on a Windows machine.
- Opened Netbeans
- Added my code back as a project by going to File->New Project...
- Checked autocomplete and it worked!