thSoft / elysium

LilyPond IDE for Eclipse
http://elysium.thsoft.hu
14 stars 3 forks source link

Separate syntax updating from compiling #167

Closed nittka closed 6 years ago

nittka commented 6 years ago

I see the following issues with the current syntax updater implementation (and maybe the bigger compile issue).

Syntax update is done only for the file it is explicitly invoked on

Coupling syntax update with compilation may be problematic, if compilation is to be done only for ly-files. Syntax update would not be possible for non-ly files.

Frequency of syntax update

Again, coupling it with compilation may not be the best option. Syntax update is not necessary on each compilation. Once it is updated, there is no need for another invocation until the next LilyPond version is used. It may make more sense to have a separate command "Update Syntax", analogous to "recompile selected".

Outdated marker

In a recent commit, I removed the "uptodate" Marker which seemed obsolete. I think, it may have been necessary, because of the syntax update. For an already uptodate ly-File, syntax update will not create a changed resource-description (LilyPondBuilder), but an IResourceDelta (OutdatedMarkerAdder). As a consequence, right after removing the marker due to compilation, it is added again. Technically, the problem is that the outdated marker is not added because of a modified recompile hash (it is added in any case, even if the content is not changed). The OutdatedMarkerAddeder-logic should be part of the regular LilyPondBuilder - the marker should be added for new or modified files and potentially removed by the actual compiler run.

Potential solutions

My personal preferene would be to completely decouple syntax update from compilation.

thSoft commented 6 years ago

I totally agree. You usually perform syntax updating once for the files you work on when you update LilyPond, so it is better to have a separate manual command for it.

nittka commented 6 years ago

When separating compiler and syntax updater, the console should be instantiated only if it is really needed (i.e. when compilation really takes place)

nittka commented 6 years ago

Syntax update and compilation has been separated. Syntax update can by performed on any source file, compilation only on ly files. Separate consoles are used and they are created only if output is expected.