# create-resource-file
**Repository Path**: qiqi_chen/create-resource-file
## Basic Information
- **Project Name**: create-resource-file
- **Description**: 一个强大的IntelliJ IDEA插件,帮助您在测试代码中快速创建资源文件和目录。
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-03-31
- **Last Updated**: 2025-03-31
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Create Resource File Intention
[English](#english) | [中文](#中文)
# Create Resource File Intention
A powerful IntelliJ IDEA plugin that helps you quickly create resource files and directories in your test code.
## Features
- 🚀 Quick creation of resource files and directories from test code
- 📁 Automatic parent directory creation
- 🔍 Smart path detection and validation
- 📝 Support for multiple file types (.sql, .txt, .csv)
- 🎯 Context-aware (only available in test code)
## Installation
1. Open IntelliJ IDEA
2. Go to `Settings` (or `Preferences` on macOS)
3. Navigate to `Plugins`
4. Search for "Create Resource File Intention"
5. Click `Install`
## Usage
1. Place your cursor on a string literal containing a resource path in your test code
2. Press `Alt+Enter` (or `Option+Enter` on macOS) or click the intention icon
3. The plugin will automatically create the corresponding resource file or directory in `src/test/resources`
### Example
```java
// Place cursor on the string literal
String resourcePath = "data/test.sql";
// Press Alt+Enter or click the intention icon
// Will create file at src/test/resources/data/test.sql
```
## Requirements
- IntelliJ IDEA 2023.1.5 or later
- Java 17 or later
- Test code must be in `src/test/java` directory
## Limitations
- Only works in test code (src/test/java)
- Path string must contain path separators (/ or \)
- Resource files will be created in `src/test/resources` directory
## Development
### Building from Source
1. Clone the repository
2. Open the project in IntelliJ IDEA
3. Run `./gradlew build` (or `gradlew.bat build` on Windows)
### Running the Plugin
1. Run `./gradlew runIde` (or `gradlew.bat runIde` on Windows)
2. A new IntelliJ IDEA instance will start with the plugin installed
3. Test the plugin in the new instance
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
---
# Create Resource File Intention
一个强大的IntelliJ IDEA插件,帮助您在测试代码中快速创建资源文件和目录。
## 功能特点
- 🚀 从测试代码快速创建资源文件和目录
- 📁 自动创建父目录
- 🔍 智能路径检测和验证
- 📝 支持多种文件类型(.sql、.txt、.csv等)
- 🎯 上下文感知(仅在测试代码中可用)
## 安装方法
1. 打开 IntelliJ IDEA
2. 进入 `Settings`(macOS上是 `Preferences`)
3. 导航到 `Plugins`
4. 搜索 "Create Resource File Intention"
5. 点击 `Install`
## 使用方法
1. 将光标放在测试代码中包含资源路径的字符串字面量上
2. 按下 `Alt+Enter`(macOS上是 `Option+Enter`)或点击意图图标
3. 插件会自动在 `src/test/resources` 目录下创建对应的资源文件或目录
### 使用示例
```java
// 将光标放在字符串字面量上
String resourcePath = "data/test.sql";
// 按下 Alt+Enter 或点击意图图标
// 将在 src/test/resources/data/test.sql 创建文件
```
## 系统要求
- IntelliJ IDEA 2023.1.5 或更高版本
- Java 17 或更高版本
- 测试代码必须在 `src/test/java` 目录中
## 使用限制
- 仅在测试代码(src/test/java)中可用
- 路径字符串必须包含路径分隔符(/或\)
- 资源文件将创建在 `src/test/resources` 目录下
## 开发指南
### 从源码构建
1. 克隆仓库
2. 在 IntelliJ IDEA 中打开项目
3. 运行 `./gradlew build`(Windows上使用 `gradlew.bat build`)
### 运行插件
1. 运行 `./gradlew runIde`(Windows上使用 `gradlew.bat runIde`)
2. 将启动一个新的 IntelliJ IDEA 实例,其中已安装此插件
3. 在新实例中测试插件
## 贡献指南
欢迎提交 Pull Request 来改进这个项目!
## 许可证
本项目采用 Apache License 2.0 许可证 - 详见 LICENSE 文件。