ceylon-ide-intellij
ceylon-ide-intellij copied to clipboard
model updates should not block purely-local refactorings
For example, right now I can't Inline a local value when a model update is in progress.
I can do the scenario you described. For example in AbstractIntention, which is large enough to produce model updates that last 1-2s, I added the following code:
value h = "h";
print(h);
After forcing an update using ⌘⌥U, I can inline h while the model is being updated.
it probably depends on the project for on model update is running. In your case you have 2 project with one depending on the other. You should probably test with a full model update, ensure you're testing during a model update on the right project by looking in the status bar.
One thing that is not possible is calling intentions when the editor is reparsing the files and recomputing all the annotations (just after the model update), i.e. the short period when all the gutter icons and warnings are removed from the editor before being redrawn. I think that's a limitation in the IDE though.
You should probably test with a full model update, ensure you're testing during a model update on the right project by looking in the status bar.
Well, during a full model udpate in plugin-ceylon-code, I can call one intention, but once it has been applied, the file has to be reparsed in order to compute the new intentions, and for that to work we currently need to wait for the model update to finish.
From what I understand:
- during full model updates, the model manager holds a lock while typechecking source files
- when you modify a file during full model updates, it cannot be locally typechecked because it can't acquire a lock on the model
- quick assists and refactorings like Inline currently need a typechecked phased unit, which cannot be computed because of the two previous points
I'm wondering if it is safe to use the "last typechecked phased unit" in refactorings/assists, I think in some cases it could cause problems.
I'm moving this issue to 1.3.5 because I won't have time to fix it before the release.