Why does the default IntelliJ default class javadoc comment use non-standard syntax? - intellij-idea

Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "#author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when available?
For reference here is an example:
/**
* Created by IntelliJ IDEA.
* User: jstauffer
* Date: Nov 13, 2007
* Time: 11:15:10 AM
* To change this template use File | Settings | File Templates.
*/

I'm not sure why Idea doesn't use the #author tag by default.
But you can change this behavior by going to File -> Settings -> File Templates and editing the File Header entry in the Includes tab.
As of IDEA 14 it's: File -> Settings -> Editor -> File and Code Templates -> Includes -> File Header

In AndroidStuido 1.0.2 on Mac
Go in Preferences
then on left span File and Code Templates
After selecting file and code templates on right hand side select includes tab select
file Header and change your file header.

The default is readable, usable, but does not adhere to or suggest any coding standard.
I think the reason IntelliJ doesn't use the Javadoc tags in the default, is so that it avoids possible interference with any coding/javadoc standards that might exist in development shops. It should be obvious to the user if the default needs to be modified to something more appropriate.
Where I am working, the use of author tags is discouraged, for various reasons.

Because it's a default file template that you're supposed to change to your organization's standard, or your tastes.
My best guess.

It is likely that the header snippet you show is older than javadoc and was just borrowed from some coding standard document, probably written for C++.

Related

IntelliJ syntax highlighting for jinja files (.jinja, .j2)

Question is pretty much in the title. Does IntelliJ have native syntax highlighting for .jinja and .j2 files?
If not is there a plugin?
This plugin: https://plugins.jetbrains.com/plugin/7792-yaml-ansible-support offers some support for jinja files.
To ensure that this plugin is associated with jinja files:
Go to File > Preferences > Editor > File Types
Under Recognized File Types scroll down to YAML/Ansible and select it
Under Registered Patterns click the + icon and enter *.jinja.
With this configuration in place your jinja files will open into this plugin. If they do not, then jinja files must be already associated with one of the other Recognized File Types in which case you'll need to scroll through them to find the culprit and remove *.jinja from its Registered Patterns.
Try the Python plugin with IntelliJ IDEA Ultimate, that has support for Jinja2 Templates.
With recent version of Intellij, you don't need any plugin any more.
Go to File > Settings > Editor > File Types
Under Recognized Files Types, choose Jinja 2 Template
Under File Name Patterns add *.j2 for jinja2, and/or *.jinja for jinja
For Ansible yaml jinja 2 templates:
Under Recognized Files Types, choose YAML/Ansible
Under File Name Patterns add *.yaml.j2 and *yml.j2
Just for sanity sake. I found my solution in a combination of both answers previously posted.
Besides the Python plugin as #Andrei states it is needed that the file extension is recognized as explained above by #glytching: File > Preferences > Editor > File Types, for me the pattern *.j2 was missing.
As a good thing to do also would be to mark the directory as Template as described in section To define template directories on the referenced templates link given by #Andrei:
1. In the Settings/Preferences dialog, click the Project Structure page.
2. Choose the directory to be marked as a template root.
3. Do one of the following:
* Click Templates on the toolbar of the Content roots pane.
* Choose Templates on the directory's context menu.

IntelliJ does not recognize kotlin file after deleting it and recreate with the same name

I am currently having a problem with IntelliJ. I am using Kotlin in my project. I have deleted a file (let's say test.kt), and now, I want to create a new file with the same name. IntelliJ does not recognize the kotlin syntaxe and show it as a text file.
When I have deleted I have unchecked "safe delete" and "Search in comment and strings"
Can anyone help me in this matter ?
Edit : I tried to delete .idea and .iml file, restart intelliJ. It does not change anything.
"Overrid File Type" to Kotlin would work.
Expanding on a comment:
Is test.kt listed in Preferences > Editor > File Types > Text, under the Registered Patterns? An entry there may override the default Kotlin filetype
I had a class, MyProxy.kt, that as the question implies was not being picked up as a Kotlin class in IntelliJ. I scrolled through my list of file associations and did not find anything that could match MyProxy.kt except for the Kotlin extension, *.kt (it is entirely possible I missed something.)
Most regex matching will apply the most specific rule, though. On the off chance my class was being picked up by another association, I explicitly declared it as a Kotlin file pattern. It is a little hacky, but it did work! My Kotlin file name patterns are now:
*.kt
*.kts
*.main.kts
MyProxy.kt
Note: IntelliJ did complain that *.kt would already catch MyProxy.kt, but I overrode it.
Ctrl+alt+s, Editor, File Types, under recognized filetypes,
Under Filetype auto-detected by file content...
remove Main.kt

How do I make my modified Intellij 'intention' available to my colleagues?

I have modified an Intellij 'intention'. (I changed the initialization of the JUnit test class).
How do I make this available to other members of my organization? We are all working on the same Intellij 'project', but I believe that these changes are on a per-user, not per-project basis. (If there is a way to make the changes apply only to one project, I would prefer that).
File | Export Setting / File | Import Settings.
Are more robust way would be to use the Settings Repository plug-in.
Templates are stored in the %CONFIG% directory, fileTemplates subdirectory.
To export the file, you set the 'Schema:' pulldown in the upper right corner of 'Settings->Editor->File and Code Templates->Code tab' to 'Project' This will cause IDEA to create a folder PROJECT/.idea/fileTemplates/code, and put your modified file there. Details are in:
https://www.jetbrains.com/help/idea/2016.3/file-and-code-templates.html#d2040410e142

Is there a way to change the Doxygen term Modules in the tree and in the right pane pages to something else?

I am using Doxygen groups and therefore see them listed in the Doxygen navigation tree under Modules, as expected. My project is documenting integration using Zend modules and therefore Doxygen Modules and the Zend modules tend to overload the term modules and make it confusing for the readers. My question is: is there a way, preferably an automated way, to change the Doxygen term Modules in the tree and in the right pane pages to something else?
I've sucessfully changed the word 'Modules' in the past, but I've only ever needed to do this for the top-of-page tabs, and not the navigation tree. The method I used than may also work for you:
You need a fresh Layout file.
Generate one with doxygen -l layoutfilename.xml
Locate the line containing type="modules"
Change the title entry from "" to "Your Word" - I used "Index"
Specify the replacement layout file in you doxyfile.
After you did like the suggestion above.
If you want to manually replace it for PDF file that generates from latex you can open refman.tex go to %--- Begin generated contents --- and change to something like this:
(Note that I marked the lines you should edit with <========)
%--- Begin generated contents ---
\chapter{Main Page}
\label{index}\hypertarget{index}{}\input{index}
\chapter{Index Index} <========
\input{index} <========
\chapter{Index Documentation} <========
\input{whatever was here before}
%--- End generated contents ---
After that go to modules.tex and change the filename to index.tex (for this example).

How to disable code formatting for some part of the code using comments?

I'd like to selectively disable the IntelliJ IDEA code formatter for a portion of code just like I can in Eclipse. Does IntelliJ support this feature, and if so, how do I use it?
Since version 13 it's possible to wrap the code with
// #formatter:off
...
// #formatter:on
IntelliJ IDEA v.2018+:
File > Settings > Editor > Code Style
IntelliJ IDEA v.2016+:
Preferences > Editor > Code Style
IntelliJ IDEA v.14+:
Preferences > Editor > Code Style > Formatter Control
You can change the formatter control markers, as long as they're in comments.
Ensure formatter markers in comments are enabled, as shown in the following figure:
Note for Carlos' answer of #formatter:off and #formatter:on to work, you may need to enable the preference first:
Discovered via How to config intellij-idea not format some part of the code?
IDEA-56995 Disabled code formatting per region using comments
In xml files, use:
<!-- #formatter:off -->
<!-- #formatter:on -->
Obsolete answer from 2010:
No, it's not possible right now, I've submitted a new issue which you can track.
As a temporary solution you can use external formatter plug-in for IDEA which can utilize Eclipse code formatter (I didn't check whether this particular option is supported).
It's currently not possible to exclude entire files (like regression test data xmls) from formatting. See https://youtrack.jetbrains.com/issue/IDEA-167112