Find class not working

One of my favourite features of IntelliJ is how the editor will automatically import classes as they are needed.
Usually I will type the name of the class that I want to use and if it has not already been imported, IntelliJ will pop-up a suggestion to import the class (Alt-Enter). If there are several classes with the same name, then Alt-Enter will present a list of possible options.
After choosing the appropriate class, an import statement will be generated.
This feature is very important as it saves me from having to manually type the import statement for every class I wish to use.

However, this feature has been playing up lately.
Now, when I type the name of a class, the class name turns red and I get no pop-up box.
Also, if I try to find the class (contained in one of my JARs) using Ctrl-N, it does not appear.
If I manually type the import statement, the editor will be happy and the code will compile (thus proving that the class is on the classpath).

I have found that by deleting various dependencies I can get the import pop-up working; and at the same time I can find the classes using Ctrl-N.
However this is very frustrating (adding and deleting dependencies) because unless I have all my JARs on the classpath the project will not compile.

Has anybody else experienced this issue?
Is there a bug in IntelliJ 7.0.3 (build 7757)?
Or is there some configuration that I need to set so that all classes in my classpath will be accessible inside the editor?

4 comments
Comment actions Permalink

I am not sure if this helps, but the code analysis seems to freeze part way through analysing the file with the missing imports.
For example, it will get to 41% complete and never get any further.
As a result, I get some very unexpected code errors (red lines appearing where they shouldn't, other errors not being picked up).

Hopefully that can help you to understand the root cause of the problem.

Note: I have tried configuring the editor to automatically import unambiguous classes but that does not seem to make any difference.

0
Comment actions Permalink

Hello Justin,

Please delete the caches directory (%USER_HOME%\.IntelliJIdea70\system\caches)

One of my favourite features of IntelliJ is how the editor will
automatically import classes as they are needed.

Usually I will type the name of the class that I want to use and if it
has not already been imported, IntelliJ will pop-up a suggestion to
import the class (Alt-Enter). If there are several classes with the
same name, then Alt-Enter will present a list of possible options.

After choosing the appropriate class, an import statement will be
generated.

This feature is very important as it saves me from having to manually
type the import statement for every class I wish to use.

However, this feature has been playing up lately.

Now, when I type the name of a class, the class name turns red and I
get no pop-up box.

Also, if I try to find the class (contained in one of my JARs) using
Ctrl-N, it does not appear.

If I manually type the import statement, the editor will be happy and
the code will compile (thus proving that the class is on the
classpath).

I have found that by deleting various dependencies I can get the
import pop-up working; and at the same time I can find the classes
using Ctrl-N.

However this is very frustrating (adding and deleting dependencies)
because unless I have all my JARs on the classpath the project will
not compile.

Has anybody else experienced this issue?
Is there a bug in IntelliJ 7.0.3 (build 7757)?
Or is there some configuration that I need to set so that all classes
in my classpath will be accessible inside the editor?

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


1
Comment actions Permalink

Thanks. That seems to work.


Please delete the caches directory (%USER_HOME%\.IntelliJIdea70\system\caches)

>

0
Comment actions Permalink

Thanks Dmitry , it works

0

Please sign in to leave a comment.