Book a Demo

Author Topic: Losing "Notes" formatting on re-sync model to code  (Read 3555 times)

EricP

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Losing "Notes" formatting on re-sync model to code
« on: January 11, 2010, 07:48:29 am »
I select "Attributes" of a class, and in the Display Attributes box I select an attribute and type in some Notes like:

  This is a sentence in a note.

  This is another sentence in the same note.

  This is a third sentence in the same note.

Now when I generate code I get something like:

/**
 * This is a sentence in a note.
 *
 * This is another sentence in the same note.
 *
 * This is a third sentence in the same note.
 */
int myClassAttrib;

Note the blank lines, prefaced with * in the comments.  So far so good.

Now make a code change and re-sync the model with the code, and when I look at the Notes box in the Display Attributes box for myClassAttrib, I see:

This is a sentence in a note. This is another sentence in the same note. This is a third sentence in the same note.

All my formatting is gone!

Generate code again, and I get:

/**
 * This is a sentence in a note. This is another sentence in the same
 * note. This is a third sentence in the same note.
 */
int myClassAttrib;

I'm trying to document my code in a readable way using EA, and it's important that I be able to insert white space and not have it trashed every time I do a round trip.

Any solution for this?

Version is 7.5.850.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Losing "Notes" formatting on re-sync model to
« Reply #1 on: January 11, 2010, 09:38:05 am »
Tools | Options | Source Code Engineering | Remove Hard Breaks from comments on import.

EricP

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Losing "Notes" formatting on re-sync model to
« Reply #2 on: January 11, 2010, 11:15:21 am »
Quote
Tools | Options | Source Code Engineering | Remove Hard Breaks from comments on import.

Good evening, Simon.

Yes, thanks, I found that, after I posted my note.  However when I round-trip with that option unchecked, the formatting looks worse... lots of hard breaks are inserted into the model in places where I didn't put them and really makes the formatting look bad, then when I generate code again it makes things worse.

As a workaround (a really unsatisfactory one, but the only one I could come up with), I took the sentences/paragraphs I wanted to maintain as separate paragraphs and made them bulleted items.  That fills my source code comments with things like <ul><li></li></ul> etc., which really looks bad, but at least it keeps separate the things I want to keep separate.

EricP

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
Re: Losing "Notes" formatting on re-sync model to
« Reply #3 on: January 13, 2010, 06:17:04 am »
Quote
Tools | Options | Source Code Engineering | Remove Hard Breaks from comments on import.

Simon;

As I indicated earlier, unchecking "remove hard breaks" won't work because then ALL of the end-of-lines in the source show up as new lines in the model and make a real mess (line breaks in the middle of the line, full length lines alternating with short lines, etc.).

I have a sort of a workaround that seems to partially fix the problem... in the Notes in the model, highlight every paragraph separately, and set it to Bold.  Then, on import, every <b></b> tag pair is formatted as a separate paragraph in the model.

I say it "partially fixes" the problem because I still lose all of my whitespace (blank lines) in the note in the model.

I just tried another workaround... anyplace I need a blank line in the model, I insert <b>.</b> in the source code (with a period in between the <b> and </b>... doesn't seem to work without something between the tags).  That does the trick, more or less, but it is really kludgy and wastes time.

Do you suppose that in 7.5.851 you can add some recognition for line break tags (<br>) or paragraph break tags (<p>) so that if the import facility sees a line break or paragraph break in the source code comment it will insert a line break or double line break in the model?  That would fix the problem, although to be really complete you'd have to implement a way to insert those breaks in the model prior to code generation.  I'll take it if it only works on import (i.e. you have to manually add them to your source code before import), though.