How often does incremental compilation run in Java in Eclipse / Intellij?

I understand that Eclipse uses its own compiler for Java (ECJ), which has the ability to perform incremental compilation. Of the majority of the readings I received, this compilation is usually initiated by the save action, but this does not seem to coincide with the fact that you receive feedback on compilation errors almost immediately after entering one element / word of the code. I did not find any documentation or literature in which says to what extent this is caused (i.e. each word, letter, line)? Is there any additional analysis of the background code? Although, in addition to detecting errors in the syntax, I do not see how this can detect semantic errors that can only be detected during compilation.

+6
source share
1 answer

The tight compiler integration allows Eclipse to call the compiler in all situations, two of which are relevant to this issue:

The term "incremental compilation" usually refers to compilation on save, which can then initiate the compilation of more files depending on the modified file. In technical jargon, this is called "building", which reads .java files and creates .class files.

Even more direct feedback is given by type compilation. This compilation is based on working copies in memory, not on files. You can even edit several dependent files without saving, and the compilation can already see the changes made to other working copies. In technical jargon, this is called "reconciliation." Although this function is implemented by calling the full compiler, reconciliation does not create any class files.

Regarding the initial question on trigger detailing: Coordination is in line for each editor of dirty regions. The recording of dirty areas is initiated by pressing the keys in the editor. Then the queue is counted with a default delay of 500 ms.

In addition to more immediate feedback, users will find that reconciliation only creates error markers in the editor, and creation additionally makes these markers visible in the Problems or Markers views.

0
source

All Articles