Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Autocomplete not Working... Only for AWT? [duplicate]

Tags:

java

eclipse

awt

The title pretty much explains it.

Autocomplete won't work in Eclipse, but only when I use it on objects related to java.awt. The methods overriden from Object appear, but that's it.

Here's an example

It happens in every project, not one in particular. I've tried reinstalling Eclipse, didn't work. Any help is appreciated.

like image 948
Krusty the Clown Avatar asked Oct 10 '21 00:10

Krusty the Clown


Video Answer


1 Answers

awt contains the List class (java.awt.List).

It's an unmitigated disaster, that. 99.9995872858% of the time that you type List and hit autocomplete, you just want eclipse to auto-import java.util.List, instead, until the most recent version, it popped up a non-modal dialog: Did you mean java.awt.List or java.util.List?

Programmers, being their usual lazy/incapable self, whined about this. That was a bit daft of them; there is a trivial setting in eclipse to banlist an entire package, so that it doesn't show up pretty much anywhere: Not in the Open Type dialog, and not in autocompletes. That's the 'Type Filter' feature and it's been around for years.

But programmers decided to continue to whine instead of add the setting.

With that context in mind, this should now make sense:

java.awt.* is now on this banlist by default.

But, you unique snowflake you, you found a time machine or cryosleep capsule, and slept through 20 years of history. Apparently, what other possible explanation could there be that you're still using AWT?

At any rate, simply take java.awt off that banlist and all will be well.

Open your eclipse workspace preferences, type 'Type Filters' in the filterbox. You're looking for setting java > Appearance > Type Filters. Click that, then uncheck java.awt.

like image 57
rzwitserloot Avatar answered Nov 15 '22 14:11

rzwitserloot