# Idea Plugin

## Prepare

* Project JDK: 1.7+
* Gradle: 3.0+（Require JDK1.8+ for gradle）

## Build

```
cd p3c-idea
gradle clean buildPlugin
```

## Run plugin

```
cd p3c-idea
gradle runIde
# run specific IDEA
gradle runIde -Pidea_version=14.1.7
```

## Use p3c-common as your plugin dependency

```groovy
compile 'com.alibaba.p3c.idea:p3c-common:1.0.0'
```

## [中文使用手册](/idea-plugin/readme_cn.md)

## Install

### Install from repositories

1. Settings >> Plugins >> Browse repositories...

   ![Switch language](/files/-LTuXR8Gga_lhZZat7iZ)
2. &#x20;Search plugin by keyword 'alibaba' then install 'Alibaba Java Coding Guidelines' plugin

   ![Switch language](/files/-LTuXR8INpNL38p2dU0q)
3. Restart to take effect.

   **Install from local zip file.**
4. Open <https://plugins.jetbrains.com/plugin/10046-alibaba-java-coding-guidelines> and download the latest version zip file.

   &#x20;![download](https://gw.alicdn.com/tfscom/TB1WcF3hzlxYKJjSZFuXXaYlVXa.png)
5. Settings >> Plugins >> Install plugin from disk...,select the downloaded zip file in previous step then restart your idea

   &#x20;![](https://gw.alicdn.com/tfscom/TB1WFsKiqigSKJjSsppXXabnpXa.png)

## Use

1. Switch language

   ![Switch language](/files/-LTuXR8KOf_3GC5qFKFA)
2. Inspections

   ![Real time](/files/-LTuXR8MO0dvrkfGGCOV)

   ![Settings](/files/-LTuXR8ODOgLemJ6KHGH)
3. Code Analyze

   ![Settings](/files/-LTuXR8QJilAxq8v156p)

   We use the idea standard Inspection Results to show our violations.

   ![Result](/files/-LTuXR8SethGKCoR-VP1)

   We can also analyze file which is modified before vcs checkin.

   ![Before Checkin](/files/-LTuXR8UFtwH_FgiTplZ)

## Other

1. \[中文乱码解决方法]\(<https://github.com/alibaba/p3c/issues/32#issuecomment-336762512>)
   * Appearance\&Behavior -> Appearance -> UI Options -> Name 里面设置成微软雅黑（microsoft yahei light）

     ![Font](/files/-LTuXR8Wj3xae_4ykwH4)
   * Switch Language to English and restart.

     ![Switch language](/files/-LTuXR8Yoq_o-dTfFLHS)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.hongxi.org/idea-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
