When I create a Java file a Javadoc command author is added to file by me. Intellij IDEA also adds date and time which are not yet implemented to Javadoc yet as a comment. When I do auto code indentation it becomes like that:
/**
* #author kamaci
* Date: 11.01.2013
* Time: 00:47
*/
instead of:
/**
* #author kamaci
* Date: 11.01.2013
* Time: 00:47
*/
How to achieve it?
You probably want to uncheck "align parameter descriptions" in Settings->Code Style->Java->JavaDoc(tab)
You can uncheck "Enable leading asterisks".
Reference: https://www.jetbrains.com/help/idea/2016.1/code-style-java.html?origin=old_help
Related
I have a question regarding IntelliJ's comment folding.
I have the following comment:
/**
* compileNews() converts the text of TextCompiler.soundAlarm() to audio as speech.mp3
*
* #throws Exception
*/
When I fold it, it looks like:
/**...*/
Is there any way that I can get it to fold and show the first line of the comment?
such like:
/**compileNews() converts the text of TextCompiler.soundAlarm() to audio as speech.mp3*/
The text shown as a placeholder for a folded code fragment is controlled by the IDE; it cannot be changed by the user. See https://youtrack.jetbrains.com/issue/IDEA-144788 for a related YouTrack issue.
I'm using JSdoc 3.3.3 to generate documentation.
I got the below error message:
Generating output files...org.mozilla.javascript.EcmaError: SyntaxError: Unterminated parenthetical (<eval'ed string>#1(Function)#201(Function)#53(Function)#17)
I have no clue of where to start looking for that is causing this. I need help to understanding the error message.
/**
* Changes the caption (title) of the window or a widget.
*
* #param (XsString|XsChar|String|string}
* widgetName - The name of the widget.
* #param {XsString|XsChar|String|string}
* caption - The new caption.
*/
The problem is start parenthesis. That should be a curly bracket at the first #param.
/**
* Comment.
*
* <p>Hello
*
* #author me (me#domain.com)
* #version $Id$
* #since 0.1
* #checkstyle ClassDataAbstractionCoupling (500 lines)
* #checkstyle ClassFanOutComplexity (500 lines)
*/
When I reformat my code with Ctrl+Alt+L, the #since is placed after the #checkstyle tags. Is there any way to disable javadoc tag rearrangement on code reformatting?
You can uncheck Enable JavaDoc formatting in Settings/Code Style/Java/JavaDoc, which should fix the problem.
However this means that no other formatting will be performed (wrapping, alignining, etc). I haven't found a way to disable just the rearranging of tags.
You can also use this plugin with disabled JavaDoc formatting in IDEA.
With that combination you still have an asterisk * inserted at newline, and you can configure all generated JavaDoc templates for each part of code.
It also has a feature of upgrade existing JavaDoc.
I have configured my Android Studio (IntelliJ) to insert <p> characters on empty new lines in javadoc by checking the check box in Preferences > Code Style > Java > JavaDoc.
However, when I apply my formatter to my existing code base (Code > Reformat Code...), the <p> tags are not inserted.
My question is, how do I get the IDE to apply the formatter successfully for javadoc newline <p> tokens?
If you have JavaDoc like this:
/**
* Text
* <- no tag will be added here
* #author foo
*/
The <p/> tag will not be inserted between Text and #author, because it would serve no purpose there. The tags will only be inserted between lines of the description (the first part of the JavaDoc):
/**
* Text 1
* <- <p/> will be inserted on this line after reformat
* Text 2
* <- no tag will be inserted here
* #author foo
*/
I'm not certain if this is the problem you're experiencing. Let me know in the comments if it works for you with multiline description as in the second example or if it doesn't work at all.
I was able to add custom pages to the doxygen documentation even with a description (which is not realy documentated). However I have this here:
/*!
* \page fielname Here comes the title
* \brief A short introduction which explains this page.
*
* The real page content...
*/
That works fine but how I add a \brief (description) for the deprecated list? Now that looks a undocumentated page what I want to avoid.
I think what you are looking for can be achieved with the following:
/** Test class
* #deprecated Will be removed in release 2.0
*/
class Test
{
};
/** #page deprecated
* #brief Deprecated page brief
*
* Deprecated page contents.
*/