Skip to content

Commit 9ebe0f1

Browse files
author
za-zhaopengjun
committed
Release v3.1.0
1 parent e7711a7 commit 9ebe0f1

54 files changed

Lines changed: 2522 additions & 371 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ bin/
4646
src/main/resources/config/local.properties
4747
src/main/resources/binaries/
4848

49-
.cursorignore
49+
.cursorignore
50+
51+
.intellijPlatform
52+
.mcp.json

CLAUDE.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
DevPilot is an IntelliJ IDEA plugin that serves as an AI coding assistant. It integrates various AI capabilities into JetBrains IDEs, including code suggestions, bug detection, code refactoring, test generation, and code explanation. The plugin has recently added integration with Claude Code via terminal.
8+
9+
## Build and Development Commands
10+
11+
### Building and Running the Plugin
12+
13+
```bash
14+
# Build and run the plugin (launches a development instance of IntelliJ)
15+
./gradlew runIde
16+
17+
# On Windows:
18+
gradlew.bat runIde
19+
```
20+
21+
### Testing and Verification
22+
23+
```bash
24+
# Run all tests and verification tasks
25+
./gradlew check
26+
27+
# Compile Java files
28+
./gradlew compileJava
29+
30+
# Configure plugin metadata
31+
./gradlew patchPluginXml
32+
33+
# Code style verification
34+
./gradlew checkstyle
35+
```
36+
37+
### Plugin Deployment (for maintainers)
38+
39+
```bash
40+
# Sign the plugin for distribution (requires credentials)
41+
./gradlew signPlugin
42+
43+
# Publish to JetBrains Marketplace (requires token)
44+
./gradlew publishPlugin
45+
```
46+
47+
## Project Architecture
48+
49+
### Key Components
50+
51+
1. **Plugin Core**:
52+
- Entry point through `plugin.xml` with extensions for tool windows and actions
53+
- Main UI provided via custom tool window (`DevPilotChatToolWindowFactory`)
54+
- Settings management with persistent state components
55+
56+
2. **UI Components**:
57+
- Web-based chat interface using JCEF (Java Chromium Embedded Framework)
58+
- Custom terminal integration for Claude Code
59+
- Toolbar actions for quick access
60+
- Status bar widgets for state indication
61+
62+
3. **AI Integration**:
63+
- MCP (Model Control Protocol) for model server communication
64+
- Chat session management with history preservation
65+
- Code operations (insertion, replacement, new file creation)
66+
- Terminal-based Claude Code integration
67+
68+
4. **Terminal Integration**:
69+
- Custom terminal handling for Claude Code with ESC key capture
70+
- Environment variable management for local proxy configuration
71+
- Terminal session reuse and management
72+
73+
### Important Packages
74+
75+
- `com.zhongan.devpilot.actions`: Editor and toolbar actions
76+
- `com.zhongan.devpilot.cli`: Terminal and CLI utilities
77+
- `com.zhongan.devpilot.completions`: Code completion functionality
78+
- `com.zhongan.devpilot.gui`: UI components and toolwindows
79+
- `com.zhongan.devpilot.mcp`: MCP server management
80+
- `com.zhongan.devpilot.settings`: Configuration and settings
81+
- `com.zhongan.devpilot.webview`: Web view handling
82+
83+
### Configuration Files
84+
85+
- `.mcp.json`: Project-level MCP server configuration (for Claude Code)
86+
- `mcp_configuration.json`: User-level MCP configuration (settings dir)
87+
- `plugin.xml`: Core plugin definition and extension points
88+
89+
## Development Notes
90+
91+
### Claude Code Integration
92+
93+
The recent development focus has been on adding Claude Code integration to the DevPilot plugin. This integration allows:
94+
95+
1. Launching Claude Code from the DevPilot toolbar
96+
2. Handling Claude Code in IntelliJ's terminal with improved ESC key handling
97+
3. Persisting MCP server configurations to project files
98+
99+
When working with the Claude Code integration:
100+
- Check `ToolbarClaudeCodeAction.java` for the toolbar button implementation
101+
- See `TerminalUtil.java` for terminal handling and command execution
102+
- Review `McpConfigurationHandler.java` for configuration management
103+
104+
### Dependencies
105+
106+
The plugin depends on:
107+
- IntelliJ Platform SDK (targeting 2022.3 to 2025.2.*)
108+
- Java 17
109+
- Various IntelliJ bundled plugins (Java, Git4Idea, Terminal)
110+
- External libraries for HTTP communication and JSON processing
111+
112+
### WebView Integration
113+
114+
For updates to the WebView component:
115+
1. Changes should be made in the separate `devpilot-h5` repository
116+
2. Built using `pnpm install` and `pnpm run build`
117+
3. HTML file copied to `src/main/resources/webview/index.html`
118+
119+
### Important Configurations
120+
121+
- The plugin requires Java 17 or higher
122+
- It supports IntelliJ IDEs from version 2022.3 (223) to 2025.2.* (252)
123+
- For complete functionality, it requires external services:
124+
- AI gateway (can be configured in settings)
125+
- Authentication system (can be disabled)
126+
- Telemetry system (can be disabled)

build.gradle.kts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
2+
13
plugins {
24
id("java")
3-
id("org.jetbrains.intellij") version "1.12.0"
5+
id("org.jetbrains.intellij.platform") version "2.6.0"
46
id("checkstyle")
57
}
68

79
group = "com.zhongan"
8-
version = "3.0.2"
10+
version = "3.1.0"
911

1012
repositories {
1113
mavenCentral()
12-
}
1314

14-
// Configure Gradle IntelliJ Plugin
15-
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
16-
intellij {
17-
version.set("2022.1.4")
18-
type.set("IC") // Target IDE Platform
19-
20-
plugins.set(listOf("com.intellij.java", "org.jetbrains.idea.maven", "Git4Idea"))
15+
intellijPlatform {
16+
defaultRepositories()
17+
}
2118
}
2219

2320
dependencies {
21+
intellijPlatform {
22+
intellijIdeaCommunity("2022.3")
23+
24+
bundledPlugin("com.intellij.java")
25+
bundledPlugin("org.jetbrains.idea.maven")
26+
bundledPlugin("Git4Idea")
27+
bundledPlugin("org.jetbrains.plugins.terminal")
28+
testFramework(TestFrameworkType.Platform)
29+
}
30+
2431
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.2")
2532
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2")
2633
implementation("com.squareup.okhttp3:okhttp:4.10.0")
@@ -35,18 +42,18 @@ dependencies {
3542
implementation("org.apache.maven.shared:maven-shared-utils:3.4.2")
3643
compileOnly("com.puppycrawl.tools:checkstyle:10.9.1")
3744
testImplementation("org.mockito:mockito-core:5.7.0")
45+
testImplementation(libs.junit)
3846
}
3947

4048
tasks {
41-
// Set the JVM compatibility versions
4249
withType<JavaCompile> {
43-
sourceCompatibility = "11"
44-
targetCompatibility = "11"
50+
sourceCompatibility = "17"
51+
targetCompatibility = "17"
4552
options.encoding = "UTF-8"
4653
}
4754

4855
patchPluginXml {
49-
sinceBuild.set("212")
56+
sinceBuild.set("223")
5057
untilBuild.set("252.*")
5158

5259
pluginDescription.set(provider { file("description.html").readText() })
@@ -70,4 +77,4 @@ tasks {
7077
configFile = rootProject.file("checkstyle.xml")
7178
maxWarnings = 0
7279
}
73-
}
80+
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m

gradle/libs.versions.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[versions]
2+
# libraries
3+
junit = "4.13.2"
4+
5+
# plugins
6+
intelliJPlatform = "2.6.0"
7+
8+
[libraries]
9+
junit = { group = "junit", name = "junit", version.ref = "junit" }
10+
11+
[plugins]
12+
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }

gradle/wrapper/gradle-wrapper.jar

-16.7 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

gradlew

Lines changed: 30 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)