Skip to content

Conversation

@SL-Mar
Copy link
Owner

@SL-Mar SL-Mar commented Jan 25, 2026

Summary

This PR adds the ability to automatically open generated QuantConnect code files in the user's preferred editor. Users can now use the --open-in-editor flag with the generate command to launch the code in their configured editor.

Key Changes

  • New CLI options: Added --open-in-editor flag and --editor option to the generate command

    • --open-in-editor: Opens the generated code file in an editor after successful generation
    • --editor: Allows overriding the default editor (e.g., zed, code, vim)
  • New editor module (quantcoder/editor.py):

    • open_in_editor(): Launches a file in the specified editor with proper error handling
    • get_editor_display_name(): Provides friendly display names for common editors
  • Configuration updates:

    • Added editor field to UIConfig with default value of "zed"
    • Updated config serialization to include the new editor setting
  • Enhanced user experience:

    • Provides feedback when editor is successfully opened
    • Shows helpful warning if editor is not installed
    • Non-blocking editor launch using subprocess

Implementation Details

  • Editor detection uses shutil.which() to verify editor availability in PATH
  • Editor process is launched non-blocking with subprocess.Popen() and start_new_session=True to prevent blocking the CLI
  • Comprehensive error handling for missing files and unavailable editors
  • Supports common editors: Zed, VS Code, Vim, Neovim, Nano, Sublime Text, Atom, and Emacs

- Add editor config option to UIConfig (default: zed)
- Create editor.py utility module for launching editors
- Add --open-in-editor flag to generate command
- Add --editor flag to override configured editor
@SL-Mar SL-Mar merged commit 2b310d4 into main Jan 25, 2026
4 of 14 checks passed
@SL-Mar SL-Mar deleted the claude/review-gamma-branch-QGXVH branch January 26, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants