Opened 8 years ago

Last modified 8 years ago

#4141 new defect

Important missing feature: Allow save and opening of Modelica files containing syntax errors

Reported by: Dietmar Winkler Owned by: Adeel Asghar
Priority: blocker Milestone: 2.0.0
Component: OMEdit Version: v1.11.0
Keywords: Cc: Francesco Casella, Bernhard Bachmann, Rüdiger Franke, Peter Fritzson

Description

The current implementation of the OMEdit text editor makes it unfortunately unsuitable to use for teaching Modelica for beginners.

The issue is the following. New beginner do mistakes when they work on their models. And since they are beginners it might take time to fix all the issues. But since OMEdit does neither save nor open Modelica files with syntax errors the students are actually afraid to use that tool at all in order to do the modelling work. Because not being able to save your work means loosing it. The only work around is to have to work in an external editor and try loading a file until it is fixed. This is cumbersome and also encourages to actually use other file editors instead because OMEdit is basically flawed.

Not good at all. So I would like you go give this a very high priority since this is from our practically experience with students who are running away from OMEdit and which results in Modelica leaving a bad taste.

Change History (1)

comment:1 by Francesco Casella, 8 years ago

Milestone: Future2.0.0
Priority: criticalblocker

I strongly support this request from Dietmar. I understand that the architecture of OMEdit, which uses OMC to do pretty much everything with the code, makes it non-trivial to implement, but in the end the user requirements should drive the development, not the implementation issues.

I think everybody agrees that being able to save one's work at any point in time, no questions asked, is a basic requirement of any programming GUI worth its name.

I am fine with learing to be disciplined programmers the hard way (and I'm sure Dietmar is more than I am), but a tools that basically tells you "too bad, I can't save your stuff because of syntax errors, so if you save you lose everything you did, next time learn to behave" is really too much. When people learn the ropes, they should have safety restraints, so they don't fall right to the bottom if they take a false step, right?

One way to implement this, which is used by Dymola, is to store the text of the incorrect class as a string in a vendor annotation. When loading the class later, OMEdit should intercept the annotation and restore the syntactically incorrect text in the editor window. Another way could be to enclose the offending text within comments, escaping other comment markers in there appropriately, and then do some processing in OMEdit so that this is transparent to the end user.

Could any of these two options be implemented with a reasonable effort?

Note: See TracTickets for help on using tickets.