Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Jan 30, 2025

Description

refactor: centralize editor utilities and unify command handling

  • Create EditorUtils class to centralize shared editor functionality
  • Remove duplicated code between CodeActionProvider and command handlers
  • Improve command handling to work consistently for both code actions and direct commands
  • Add better type safety and error handling for editor operations

feat: add 'Add To Context' code action

  • Add new command registration and menu item

  • Add new code action type and command ID

  • Add support prompt config for adding code to context

  • Add message handling in webview for setting chat box content

  • Add logic to append selected code to existing chat input

    This pr also fix issues RooCode: Improve Code not referencing file and Text #592

image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Add 'Add To Context' code action and refactor editor utilities for improved command handling and error management.

  • Features:
    • Add 'Add To Context' code action in CodeActionProvider and EditorUtils.
    • Register new command roo-cline.addToContext in package.json and extension.ts.
    • Implement message handling for 'Add To Context' in ClineProvider and ChatView.tsx.
  • Refactoring:
    • Introduce EditorUtils class to centralize editor-related functions like getEffectiveRange, getFilePath, and createDiagnosticData.
    • Replace direct calls with EditorUtils methods in CodeActionProvider and ClineProvider.
  • Enhancements:
    • Improve command handling to support both code actions and direct commands in extension.ts.
    • Add type safety and error handling improvements in EditorUtils and CodeActionProvider.
  • Miscellaneous:
    • Update support-prompt.ts to include 'Add To Context' prompt configuration.
    • Minor updates to ExtensionMessage.ts to support new message types.

This description was created by Ellipsis for 2e56149. It will automatically update as commits are pushed.

- Create EditorUtils class to centralize shared editor functionality
- Remove duplicated code between CodeActionProvider and command handlers
- Improve command handling to work consistently for both code actions and direct commands
- Add better type safety and error handling for editor operations
- Add new command registration and menu item
- Add new code action type and command ID
- Add support prompt config for adding code to context
- Add message handling in webview for setting chat box content
- Add logic to append selected code to existing chat input
@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2025

⚠️ No Changeset found

Latest commit: 7614048

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mrubens mrubens merged commit bedd6fd into RooCodeInc:main Jan 31, 2025
4 checks passed
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