Quick fix many problems at once

前端 未结 6 1233
别那么骄傲
别那么骄傲 2020-12-05 22:50

Is it possible to quick fix all errors in a class opened in Eclipse?

I have 71 errors that are pretty much the same, I would rather not do it one-by-one.

(N

相关标签:
6条回答
  • 2020-12-05 23:07

    It depends on type of errors.If error are there because of missing imports then you can solve it by pressing CTRL + SHIFT + O. For other errors you have to solve one by one [AFAIK].

    0 讨论(0)
  • 2020-12-05 23:09

    All imports fix as CTRL + SHIFT + M

    0 讨论(0)
  • 2020-12-05 23:12

    As far as I know, there's no way to do this. Sorry!

    0 讨论(0)
  • 2020-12-05 23:13

    Often, you can fix errors en masse. There are several ways. I recommend going to your Problems view, selecting one of the errors, and hitting Ctrl-1 (quick fix). It should offer you the chance to fix all the errors of the selected type, in all files.

    You can also mouse over the error in the text editor and wait for a popup; it should say "fix 70 other errors of this type". Doing it this way applies only to the specific file.

    0 讨论(0)
  • 2020-12-05 23:16

    There are certain errors/warnings which you can fix in one go in a file e.g. missing NON-NLS tags. When you hover on an error, the quick fix list will show something like 'Fix n problems of same kind'.

    In other cases you could use a cleanup, e.g. for missing @Override annotation.

    0 讨论(0)
  • 2020-12-05 23:20

    You would get better answers if you would specify the error type. And if errors are too similar -hopefully identical-, you can always use find&replace tool.

    0 讨论(0)
提交回复
热议问题