ceylon-ide-eclipse icon indicating copy to clipboard operation
ceylon-ide-eclipse copied to clipboard

when Build Automatically is disabled, update the model when saving

Open gavinking opened this issue 10 years ago • 2 comments

When we save an editor, and Build Automatically is not enabled, we should update the central model with the updated models belonging to the CeylonParseController (the EditedPhasedUnit, I suppose).

That way, other editors would see the changes I have just saved, even though I have not yet done a full rebuild.

gavinking avatar Aug 07 '14 09:08 gavinking

After thinking about this more deeply, it seems not so straightforward. In the CeylonParseController, in order to be able to typecheck the currently edited code without any side-effect on the central model, we add the EditedPhasedUnit in a specific Package, SingleSourceUnitPackage : it allows retrieving/adding all the declarations that correspond to the current unit from/in the EditedPhasedUnit, though all other declarations are retrieved from the central model. This is a sort of proxy package corresponding to the current phased unit working copy. If I want to use the declarations of all the other units that are currently being edited, I should indeed maintain such a proxy mechanism for all the packages that contain at least one edited phased unit. Indeed that would require extending LazyPackage to allow a package, when searching for a member, to first search in edited source units before searching in the central model units. Sure this is doable, but this requires quite deep changes in the Ceylon model management, and impacts on the typechecker, model loader, etc ... are not easy to estimate.

davidfestal avatar Aug 27 '14 12:08 davidfestal

for 1.2 if we still feel it as necessary

davidfestal avatar Aug 27 '14 19:08 davidfestal