checkstyle/src/xdocs/idea.xml

73 lines
3.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Importing and debugging in IntelliJ IDE</title>
<author>Checkstyle Development Team</author>
</properties>
<head>
<title>Importing and debugging in IntellIJ IDE</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="js/anchors.js"></script>
<script type="text/javascript" src="js/google-analytics.js"></script>
<link rel="icon" href="images/favicon.png" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/ico" />
</head>
<body>
<section name="Content">
<macro name="toc">
<param name="fromDepth" value="1"/>
<param name="toDepth" value="1"/>
</macro>
</section>
<section name="Import Checkstyle Project">
<p>
If no project is currently open in IntelliJ IDEA, click Import Project on the
Welcome screen. Otherwise, select File > Import Project<br/><br/>
<img alt="screenshot" src="images/gui_screenshot_importing_idea.png"/>
<br/><br/>
<img alt="screenshot" src="images/gui_screenshot_importing_idea1.png"/>
<br/><br/>
Then Next > Next > ... Until Finish.
</p>
</section>
<section name="Debug">
<p>
Open the Check's source file by double click on it in a source tree as is shown:<br/><br/>
<img alt="screenshot" src="images/gui_screenshot_select_check_idea.png"/>
<br/><br/>
Debug the Check by putting the breakpoint at controversial place (double-click)
on the left part of line number as it is shown:<br/><br/>
<img alt="screenshot" src="images/gui_screenshot_debug_idea.png"/>
<br/><br/>
Then right-click the corresponding Unit-test file or class definition > Debug
&quot;testName&quot;<br/><br/>
<img alt="screenshot" src="images/gui_screenshot_ut_select_idea.png"/>
<br/><br/>
Then manage you debug operations F8 (Step Over), Shift+F8 (Step Out),
F7 (Step Into), Alt+F9 (Run to Cursor)
</p>
</section>
<section name="Organize Imports">
<p>
One of the Checkstyle checks we run on our own code require sertain order of import
statements. Few changes in IDE settings are required to help your IDE do it automatically.<br/>
To change formatter settings please go to File->Settings in menu.<br/>
Then in the tree go to: Editor->Code Style->Java, open Import tab (follow numbers on a
picture) and apply settings highlighted:<br/><br/>
<img alt="Organize Imports settings in IDEA" src="images/gui_screenshot_organize_imports_idea.jpg"/>
<br/><br/>
</p>
</section>
</body>
</document>