Open
Description
Bug description
When executing a DoIt with code that has syntax errors or if you load code (e.g a .cs), the compiler raises a SyntaxErrorNotification which then opens a SyntaxErrorDebugger.
- SyntaxErrorDebugger is broken and looks strange, it is hard to use, too
- Every error opens a new SyntaxErrorDebugger, making it in practice very time consuming and not scriptable
- The mechanism behind, the idea that an SyntaxErrorNotification can lead to the code being fixed in the exception raise code and then the compiler re-starting is very complex. See exception ReparseAfterSourceEditing
Idea
- The Compiler already can compiled any text to some kind of AST (we use it for syntax higlighting).
- The Code Generator can generate code for the RBParseErrorNode (this for raises a RuntimeSyntaxError and open a normal Debugger )
We should make a list of questions to answer and things todo that would allow us to just load syntactically wrong code and compile a method for it.
This would then mean that all interaction about fixing syntax errors is delayed to after the code is loaded and uses normal tools. People could even use meta-programming (e.g. a RBParseErrorNode awary ParseTreeRewriter) to fix all the methods.
TO CHECK
- Git and syntactically wrong code: Can we just store it? Or do we add a #isFaulty check to forbid commits
- Rule Engine: what happens if it sees RBParseErrorNode nodes? #12918
- Check the case that the error is in the method signature.
- Anything else?
Next step after:
- Enable it for DoIts and #evaluate:, as these do not create code that tools see, it should be save.
Fixed:
- [Compiler] fix code generation when compiling syntax errors: EnglobingError [Compiler] fix code generation when compiling syntax errors: EnglobingError #11947
Metadata
Metadata
Assignees
Type
Projects
Status
🏗 In progress