Skip to content

eclipse

This directory provides Talon voice control support for the Eclipse IDE. It defines the application context for Eclipse and overrides standard Talon actions to map voice-triggered editing, navigation, panel management, and debugging capabilities to the corresponding Eclipse keyboard shortcuts.

The integration is divided into two primary files:

  • eclipse.talon defines the voice commands, sidebars, panels, file operations, debugging actions, and refactoring utilities.
  • eclipse_win.py establishes the Windows application definitions and implements standard Talon action overrides (e.g., app, code, edit, and user) mapped to Windows-specific keyboard shortcuts.

How It Works

The voice interaction system works by binding Talon's abstract APIs to concrete keyboard operations inside the IDE.

1. Context Activation and Application Mapping

In eclipse_win.py, a module is defined that binds the eclipse identifier to the Windows process eclipse.exe:

mod.apps.eclipse = """
os: windows
and app.name: eclipse.exe
"""

This configuration triggers the generic app: eclipse context. Both eclipse.talon and eclipse_win.py activate when this context matches, ensuring commands are only interpreted when Eclipse is the focused application.

2. Standard Action Implementations

eclipse_win.py overrides the standard Talon behavior classes to match Eclipse's default Windows keybindings:

  • AppActions: Handles tab navigation (ctrl-pagedown/ctrl-pageup) and closing files (ctrl-w).
  • CodeActions: Implements toggle comment (ctrl-7).
  • EditActions: Maps typical actions like jumping to lines (ctrl-l), deleting lines (ctrl-d), indentation management, saving files, and line swapping (alt-up/alt-down).

3. Editor Feature Integrations

Both files coordinate to support standard Talon community tags:

  • Find and Replace (user.find_and_replace): Standard actions defined in eclipse_win.py wire commands like find_everywhere to ctrl-h, and find_toggle_match_by_case to alt-c.
  • Window Splitting (user.splits): Enables voice commands to split editor windows. Some of these commands are configured to rely on the popular Eclipse plugin Handysplit to perform actions like swapping focus or clearing splits.
  • Global Command Search (user.command_search): Implemented using the Eclipse "Quick Access" dialog (ctrl-3), allowing users to search and run any IDE action by voice.

4. Navigation and Voice-Only Commands

eclipse.talon exposes declarative voice commands for managing the IDE's UI state. These include:

  • View Panels: Commands like panel output, panel problems, and panel variables automate multi-step key sequences (e.g., alt-shift-q followed by a target key like c, x, or v) to focus specific workspace panels.
  • Refactoring & Navigation: Commands like imports fix (ctrl-shift-o), refactor rename (alt-shift-r), and go declaration / follow (f3) integrate with Eclipse's Java Development Tools (JDT) and other language servers.
  • Interactive Debugging: Essential debug state commands such as break point (ctrl-shift-b), step over (f6), and debug continue (f8) allow hands-free code debugging.
  • Bookmarking: Allows navigation across code files using the Quick Bookmarks extension.