---\nMigrated from CyberAgentAILab/pinjected#37\nOriginally created by @proboscis on null\n\n---\n\n## Problem
The current PyCharm plugin provides basic analysis of Python dependency injection patterns, but lacks functionality for:
- Running selected injected functions
- Managing run configurations for injected code
- Console execution support
- Proper integration with the PyCharm IDE
Background
We need to integrate the InjectedFunctionActionHelper from the existing Kotlin OpenAI plugin into our new PyCharm plugin. This helper provides functionality for running Python code with dependency injection features, managing configurations, and executing code in the console.
Implementation Branch
Reference branch: feature/pycharm-plugin in the CyberAgentAILab repository contains the initial PyCharm plugin implementation with the basic structure.
Tasks
-
Add Kotlin Support
- Add Kotlin dependencies to the Gradle build script
- Configure Kotlin compiler settings
-
Port InjectedFunctionActionHelper
- Create a Kotlin version compatible with the Java PyCharm plugin
- Adapt the helper to work with the PyCharm plugin architecture
- Ensure proper dependency resolution
-
Add Required Data Classes
- Port
PyConfiguration, ConfigurationWrapper, etc.
- Adapt serialization handling
-
Create Actions for Injected Functions
- Add action for running selected injected functions
- Add action for testing scripts in console
- Register actions in plugin.xml
-
Add Extension Points
- Configure parameter info handler
- Add code completion contributor
- Set up goto declaration handler
-
Update Plugin Dependencies
- Ensure all required dependencies are properly declared
- Check compatibility with PyCharm 2024.3.5
-
Implement Console Execution
- Port the console execution functionality
- Ensure proper Python environment setup
-
Testing and Integration
- Test with sample Python code containing injected functions
- Verify all features work properly in PyCharm
Known Challenges
- IntelliJ Platform APIs evolve rapidly and will require careful attention to documentation
- Need to use the newer
ApplicationManager.getApplication().getService() pattern for obtaining services
- Ensure plugin dependencies are correctly specified in both Gradle and plugin.xml files
- Working with Python PSI API requires attention to parameter signature requirements
Requirements
- Must work with PyCharm 2024.3.5
- Follow existing package structure of the PyCharm plugin
- Update documentation to reflect new features
References
materials/src/main/kotlin/com/proboscis/kotlinopenai/InjectedFunctionActionHelper.kt - Source code to be ported
INTEGRATION_TASK.md - Detailed integration requirements
DEVELOPMENT_CHALLENGES.md - History of challenges in PyCharm plugin development
---\nMigrated from CyberAgentAILab/pinjected#37\nOriginally created by @proboscis on null\n\n---\n\n## Problem
The current PyCharm plugin provides basic analysis of Python dependency injection patterns, but lacks functionality for:
Background
We need to integrate the
InjectedFunctionActionHelperfrom the existing Kotlin OpenAI plugin into our new PyCharm plugin. This helper provides functionality for running Python code with dependency injection features, managing configurations, and executing code in the console.Implementation Branch
Reference branch:
feature/pycharm-pluginin the CyberAgentAILab repository contains the initial PyCharm plugin implementation with the basic structure.Tasks
Add Kotlin Support
Port InjectedFunctionActionHelper
Add Required Data Classes
PyConfiguration,ConfigurationWrapper, etc.Create Actions for Injected Functions
Add Extension Points
Update Plugin Dependencies
Implement Console Execution
Testing and Integration
Known Challenges
ApplicationManager.getApplication().getService()pattern for obtaining servicesRequirements
References
materials/src/main/kotlin/com/proboscis/kotlinopenai/InjectedFunctionActionHelper.kt- Source code to be portedINTEGRATION_TASK.md- Detailed integration requirementsDEVELOPMENT_CHALLENGES.md- History of challenges in PyCharm plugin development