Issue
For some reason after I type a period "." my eclipse instance gives me a "Cannot Perform Operation - This compilation unit is not on the build path of a Java project" Error. I understand the issue, but can't seem to get it working again...
The current project that I'm busy with is a java file imported via Maven.
Eclipse Version:
Eclipse Java EE IDE for Web Developers. Version: Oxygen.2 Release (4.7.2) Build id: 20171218-0600
Solution
Thanks to both @nitind and @howlger. The issue I had was due to the fact that I had to many "Content Assist" options selected which was causing for an unnecessarily long scroll between content. This coupled with the fact that my project was imported as a Maven project and not a Java project cause the issue.
Because of it not being seen as a Java project, some of the Java "Content Assists" didn't recognize the project, which gave me the error above and because I had so many assists selected it kept giving me the error no matter how many times I scrolled.
I fixed the issue by converting the project back to java type as well as removing all the extra "Control Assist" options.
Answered By - Francois Du Toit