---\nMigrated from CyberAgentAILab/pinjected#231\nOriginally created by @proboscis on null\n\n---\n\n## Summary
Both PyCharm/IntelliJ and VSCode plugins currently use the deprecated meta_main entry point to create IDE configurations. They should be migrated to use the standard pinjected run command instead.
Current State
PyCharm/IntelliJ Plugin
// In InjectedFunctionActionHelper.kt:72
val args = "-m pinjected.meta_main pinjected.ide_supports.create_configs.create_idea_configurations $modulePath".split(" ")
VSCode Plugin
// In extension.ts:310
const result = await execAsync(`${python_path} -m pinjected.meta_main pinjected.ide_supports.create_configs.create_idea_configurations "${filePath}"`);
Issues with Current Approach
meta_main is a legacy entry point that should be deprecated
- Neither plugin passes the
design_path parameter, relying on our backward compatibility fix
- The command structure is inconsistent with how pinjected is normally used
Proposed Solution
1. Short-term Fix (Already Implemented in PR #230)
- ✅ Made
run_with_meta_context use pinjected_internal_design by default when design_path is not provided
- ✅ Added deprecation warnings to
meta_main
- ✅ Added tests to verify backward compatibility
2. Long-term Migration
Option A: Direct pinjected run command
# Instead of:
python -m pinjected.meta_main pinjected.ide_supports.create_configs.create_idea_configurations <file_path>
# Use:
pinjected run pinjected.ide_supports.create_configs.create_idea_configurations --module-path <file_path> --design pinjected.ide_supports.default_design.pinjected_internal_design
Option B: Create a dedicated IDE command
# Add a new command specifically for IDE integration:
pinjected ide-config <file_path>
# Or:
pinjected create-configs <file_path> --format idea
Migration Plan
Phase 1: Prepare pinjected (Current Release)
Phase 2: Update IDE Plugins (Next Release)
Phase 3: Remove Deprecated Code (Future Release)
Testing Requirements
-
Backward Compatibility Tests
- Old IDE plugins with new pinjected ✅ (tested in PR #230)
- New IDE plugins with old pinjected (needs version detection)
-
Integration Tests
- Test new command structure with both IDE plugins
- Verify all configuration types are created correctly
- Test error handling and edge cases
Benefits
- Consistency: Uses standard pinjected command structure
- Clarity: Explicit design specification instead of hidden defaults
- Flexibility: Easier to add new features and options
- Maintainability: Removes special-case code for IDE integration
Related Files
/pinjected/meta_main.py - To be deprecated
/pinjected/ide_supports/create_configs.py - Needs refactoring
/ide-plugins/pycharm/src/main/kotlin/com/proboscis/pinjectdesign/kotlin/InjectedFunctionActionHelper.kt - Needs update
/vscode-plugin/pinjected-runner/src/extension.ts - Needs update
Related PR
- #230 - Implements short-term fixes and adds tests
Acceptance Criteria
---\nMigrated from CyberAgentAILab/pinjected#231\nOriginally created by @proboscis on null\n\n---\n\n## Summary
Both PyCharm/IntelliJ and VSCode plugins currently use the deprecated
meta_mainentry point to create IDE configurations. They should be migrated to use the standardpinjected runcommand instead.Current State
PyCharm/IntelliJ Plugin
VSCode Plugin
Issues with Current Approach
meta_mainis a legacy entry point that should be deprecateddesign_pathparameter, relying on our backward compatibility fixProposed Solution
1. Short-term Fix (Already Implemented in PR #230)
run_with_meta_contextusepinjected_internal_designby default whendesign_pathis not providedmeta_main2. Long-term Migration
Option A: Direct pinjected run command
Option B: Create a dedicated IDE command
Migration Plan
Phase 1: Prepare pinjected (Current Release)
run_with_meta_context(PR #230)Phase 2: Update IDE Plugins (Next Release)
Phase 3: Remove Deprecated Code (Future Release)
meta_main.pyTesting Requirements
Backward Compatibility Tests
Integration Tests
Benefits
Related Files
/pinjected/meta_main.py- To be deprecated/pinjected/ide_supports/create_configs.py- Needs refactoring/ide-plugins/pycharm/src/main/kotlin/com/proboscis/pinjectdesign/kotlin/InjectedFunctionActionHelper.kt- Needs update/vscode-plugin/pinjected-runner/src/extension.ts- Needs updateRelated PR
Acceptance Criteria
pinjected runcommand