How Does One Simply Forget An Import

You forget like this

import forget from memory
1 Like

i wish

import *

worked for everything.

3 Likes

That’ll be a nightmare for the IDE since it’ll have to look up every single class available in the entirety of the classpath whenever you use “intellisense” or ctrl+space at any point.

3 Likes

I was using eclipse on this crappy computer and it would crash about 30% of the time that I would try to use intellisense if I had a lot of external libraries.

I think I know what you mean by this, and I will try to elaborate what I think of it.

Imports probably had a purpose back when you were writing files in edit.com on a MSDOS machine, or whatever the Unix equivalent was. There was no IDE to keep track of what you referenced. Now that we have IDEs that do fancy things for us, is it really necessary to have a list of imports in the source file? Or can the IDE autonomously add, remove, and track imports in some side panel, and at compile time hand those over? There may be an issue with conflicting imports (I guarantee there is more than one library with a “Main.class” or “Network.class”; just examples but you know what I mean), and in these cases, yes you would have to stop and pick, but in other cases where you are dealing with “CraftPlayer” or “SpongePlugin”, its pretty unique and can be automatic. I am no expert though, someone tell me what they think.Or if I even made sense.

1 Like

Yes! Exactly what I meant ! :smiley:

But isn’t that what an IDE does?

This is how I work with Eclipse:

Not all manage it automagically like that, and the few I’ve played with just give you the errors instead of trying to solve them itself… :confused:

IntelliJ works better than that, everyone should give IntelliJ a try! :wink:

My Eclipse install is picky; for it to auto import, I have to without fail create a reference to an object (that needs importing) and then use that object in some way. If I have any errors in syntax or jump lines, it then refuses to auto import Simply declaring it won’t auto import for me. Maybe there’s something in the sea of preferences I can change.

Nope. I’d rather have a definite list of what I mean than some ambiguous name that I have to look for everytime. Imports have a reason. And just because most people use an IDE, I wouldn’t want to lose the ability to code in npp.

Fair enough. I just think there has to be a better way to auto import.