Author Topic: Inconsistant and unexpected javadoc formatting  (Read 3083 times)

rozum

  • Senior Community Member
  • Posts: 148
  • Hero Points: 5
Inconsistant and unexpected javadoc formatting
« on: April 26, 2013, 03:52:06 PM »
I have noticed some inconsistent behaviors with respect to the automated JavaDoc like algorithm.  For example, the following code:
Code: [Select]
class test
{
  //! This is a test
  FakeClass * getFakeClass( ) const;
};


Will produce the expected output:
Code: [Select]
class test
{
  //! This is a test
  //!
  //! @return
  FakeClass * getFakeClass( ) const;
};

If the JavaDoc editor is used (e.g., <shift><ctrl>d).

If I instead, place the cursor at the end of the comment ("//! This is a test") and inserts a new line (<Enter>), the following following malformed output is produced:

Code: [Select]
  //!
  //!
  //! \author user1 (4/26/2013)
  //!
  //! \return FakeClass*
  FakeClass * getFakeClass( ) const;

Note the following:
  • The original comment has been removed
  • The '@' character has been replaced by '\'
  • The return "description" area is now the the return type "FakeClass*"
  • Their is an "author" entry and date.





patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Inconsistant and unexpected javadoc formatting
« Reply #1 on: April 29, 2013, 02:18:34 PM »
That's surprising, and it doesn't seem to be new to v18.

In the second case when you're hitting return, what's happening (incorrectly) is an alias expansion - it will always replace the text with whatever you have defined as the comment expansion in Languages -> C/C++ -> Comments -> Doc Comments/Edit Expansion.  Which just wipes out what you typed.

So I'll fix that for the beta do it does not do the alias expansion then.  Arguably, it should be smart enough to do something more like the comment editor in that case, but that's too big of a feature change to sneak into the beta.