Add better support for multi-file error checking (4)
Multi-file semantic analysis still requires too much manual labor. Adding error markers to external files affected by local changes is currently only possible by returning them from the “observer” strategy. A better approach may be to return a list of affected files, letting the IDE schedule their re-analysis. This way the local analysis can just identify that there are external errors based on signatures, and doesn’t have to bother with reparsing etc. This also ensures better responsiveness by directly showing local errors.
(see Spoofax/23: Add better support for multi-file code generation)
(see Spoofax/179: Add primitives for enqueueing background transformations)
depends onsee Spoofax/12: Support reference resolving across different files in the Stratego editor)
(related to Spoofax/224: Automatically re-analyze files even if editor not open)Submitted by Lennart Kats on 26 February 2010 at 13:58
I think there should be a strategy in editor-common to enqueue other files for analysis. This should also be used when files have just been refreshed. The queue should take care not to run into a loop.
Lennart, what’s your priority for this issue? Would be great to implement this in the WebDSL editor.
Returning a list of (possibly) affected files seems like a good idea. For the background error checking, it is possible just to return ‘file has errors’ or ‘file has no errors’; the location of the errors is not interesting if the file is not open. This might save some parse time?
Not sure why this depends on Spoofax/12 ?
I changed the “depends on” to a “see”; you’re right there’s no direct requirement for Spoofax/12 to be fixed first. You also make a good point about the background error checking, that could be a nice optimization. Of course, when an editor for an external file is actually open, you do want to do precise error reporting there. I don’t suppose you have any good ideas for how to design the Stratego interface for that?
As for priority, that mostly depends on having a good use case/demand for it. We can definitely make it work if you want to use this in the WebDSL editor :)
Multi-file analysis is enabled by NBL + the index. However, I am not sure if errors in files which are not open are collected.
Closed files are also analysed as part of the incremental analysis, this updates their error markers.
Log in to post comments