-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
RefakTS CommandIssues that introduce new commands to the productIssues that introduce new commands to the productenhancementNew feature or requestNew feature or request
Description
Problem
The select command has boundary selection functionality that is currently not implemented, causing several tests to be skipped.
Current Status
Four boundary selection tests are currently skipped:
tests/fixtures/commands/select/boundary/arrow-function.input.tstests/fixtures/commands/select/boundary/class-method.input.tstests/fixtures/commands/select/boundary/inline-function.input.tstests/fixtures/commands/select/boundary/standalone-function.input.ts
What is Boundary Selection?
Boundary selection allows users to select code elements by their boundaries (e.g., entire function bodies, class methods, etc.) rather than precise character ranges.
Example Use Cases
# Select entire function including signature and body
refakts select myfile.ts --boundary function
# Select complete class method
refakts select myfile.ts --boundary method
# Select arrow function expression
refakts select myfile.ts --boundary arrow-functionImplementation Needed
1. Boundary Detection Logic
- Function boundaries: Include signature, parameters, and complete body
- Method boundaries: Include visibility modifiers, signature, and body
- Arrow function boundaries: Include parameters and expression/body
- Class boundaries: Include entire class definition
2. Selection Strategy
- Extend existing selection strategies in
src/core/services/selection/ - Add boundary-specific pattern matching
- Integrate with existing
SelectCommandarchitecture
3. Output Format
- Use existing
SelectOutputHandlerfor consistent formatting - Return complete boundary ranges rather than partial selections
Related Skipped Tests
All tests use @skip annotation and need to be enabled after implementation:
- arrow-function.input.ts - Select arrow function boundaries
- class-method.input.ts - Select class method boundaries
- inline-function.input.ts - Select inline function boundaries
- standalone-function.input.ts - Select standalone function boundaries
Acceptance Criteria
- Implement boundary selection strategy for functions
- Implement boundary selection strategy for class methods
- Implement boundary selection strategy for arrow functions
- Add boundary selection options to select command
- Update all 4 skipped boundary tests to pass:
arrow-function.input.tsclass-method.input.tsinline-function.input.tsstandalone-function.input.ts
- Remove
@skipannotations from boundary tests - Update command help text to document boundary selection options
Priority
Medium - Enhances select command functionality but doesn't block existing features.
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
Metadata
Metadata
Assignees
Labels
RefakTS CommandIssues that introduce new commands to the productIssues that introduce new commands to the productenhancementNew feature or requestNew feature or request