Save actions have a timeout, which should keep the editor responsive. The current behavior only checks the running time of the save action itself, but not the typechecking time of the compiler, which is necessary in order to get a tree of the current file that can be passed to the save action.
The timeout should consider the typechecking time as well, otherwise the editor is blocked for a long time for larger Scala files.
A further optimization could be that once a timeout occurs during typechecking, no further compiler based save actions are executed, because it is likely that all following calls for typechecking get a timeout too.
The timeout should consider the typechecking time as well, otherwise the editor is blocked for a long time for larger Scala files.
A further optimization could be that once a timeout occurs during typechecking, no further compiler based save actions are executed, because it is likely that all following calls for typechecking get a timeout too.
Leave a comment
on 2014-10-17 14:58 *
By Simon Schäfer
Description changed from Save actions have a timeout... to Save actions have a timeout...
on 2015-05-27 14:29 *
By Simon Schäfer
Enable compiler driven save actions
It is now possible to correctly abort compiler driven save actions,
therefore they can be enabled. However given that it is very likely that
timeouts occur and given that refactorings still introduce syntax errors
to files, all compiler driven save actions are marked as experimental.
Re #1002308
Branch: master
Commit: scala-ide:c7271eda5f
It is now possible to correctly abort compiler driven save actions,
therefore they can be enabled. However given that it is very likely that
timeouts occur and given that refactorings still introduce syntax errors
to files, all compiler driven save actions are marked as experimental.
Re #1002308
Branch: master
Commit: scala-ide:c7271eda5f
Consider typechecking phase for timeout of save actions
So far only the running time of the save action itself was considered in
the timeout. With this change, the typechecking phase of the compiler
that is needed for every compiler driven save action is also considered
in this timeout.
Another change is that after a timeout occurred, all further compiler
driven save actions are aborted. This should be the better behavior
because it is not likely that the time that is needed to typecheck and
refactor a file largely differs between different save actions. Therefore
it is unrealistic that further save actions can succeed. Also, a save
action can not be aborted (because interrupting the compiler thread is
not supported) and therefore another call to the compiler first have to
wait on the previous request to be completed, which makes it even more
unrealistic that further save actions can be completed successfully.
Fixes #1002308
Branch: master
Commit: scala-ide:1c10f0702f
So far only the running time of the save action itself was considered in
the timeout. With this change, the typechecking phase of the compiler
that is needed for every compiler driven save action is also considered
in this timeout.
Another change is that after a timeout occurred, all further compiler
driven save actions are aborted. This should be the better behavior
because it is not likely that the time that is needed to typecheck and
refactor a file largely differs between different save actions. Therefore
it is unrealistic that further save actions can succeed. Also, a save
action can not be aborted (because interrupting the compiler thread is
not supported) and therefore another call to the compiler first have to
wait on the previous request to be completed, which makes it even more
unrealistic that further save actions can be completed successfully.
Fixes #1002308
Branch: master
Commit: scala-ide:1c10f0702f
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|