Eclipse: Is there a way to force import into Organize Import to resolve ambiguity?

I am using Eclipse in an Android project. I upgraded to Leo, and problems started to appear ... Trying for several hours, no results.

Here is the problem:

I have dozens of com.stuff.morestuff files in my project. I would like to crtl + shift + O my project so that every import is allowed. But in each file, the eclipse asks me to resolve the ambiguities.

Therefore, I would like to impose an eclipse to choose the first choice.

Some tips

1 - I tried to create rules in the build path, but it is powerful. Example: if I exclude android.R from the build path, then it does not appear in the options, but I cannot use it explicitly in my code ...

2 - Do it manually → longer

3 - I tried to customize the Arrange Import tool, but failed.

Thank you for your responses!

+6
source share
1 answer

You can use "Settings> Java> Appearance> Type Filters". Create filters for types that you do not want to use. For instance. If you are not interested in types from the java.awt package, you can create a filter for the entire package or filter out individual types.

Filtered types are then hidden from the user interface, i.e. they are not used in the import organization or are displayed in the Open Type dialog box, etc. Note that types are still visible to the compiler, this is different from hiding types from the compiler.

+13
source

Source: https://habr.com/ru/post/893404/


All Articles