Skip to content

Conversation

@tsdevau
Copy link
Owner

@tsdevau tsdevau commented Oct 25, 2024

  • Add new preview command abstraction (not yet implemented)
  • Abstract single file extension.ts to class-based components to separate growing concerns
  • Add git extension type to git.d.ts from VSCode API repo
  • Refactor all new files:
    • Replace wildcard import with specific named imports
    • Add explicit type imports for ExtensionContext and TextDocument etc
    • Improve error message formatting with newlines for better readability
    • Remove redundant string concatenation in error logging
  • Update all tests to accomodate the updated formatting of errors

Adds a new command and content provider to enable previewing commit messages:

- Implements `previewCommitMessage` command to show editable previews
- Creates custom URI scheme `commit-preview` for preview documents
- Maintains document content state using in-memory Maps
- Handles document lifecycle events (save, change, close)
- Syncs preview content with SCM input box on save/close
- Cleans up resources when preview is closed
- Preserves original message to detect modifications
Adds a new command and content provider to enable previewing commit messages:

- Implements `previewCommitMessage` command to show editable previews
- Creates custom URI scheme `commit-preview` for preview documents
- Maintains document content state using in-memory Maps
- Handles document lifecycle events (save, change, close)
- Syncs preview content with SCM input box on save/close
- Cleans up resources when preview is closed
- Preserves original message to detect modifications
- Extract core functionality into dedicated manager classes:
  - APIKeyManager for API key operations
  - CommitMessageGenerator for message generation logic
  - ConfigManager for configuration handling
  - GitManager for Git operations
- Move API key management logic from extension.ts to APIKeyManager
- Create CommitMessageGenerator class to handle prompt generation and API calls
- Implement ConfigManager for centralised configuration access
- Add GitManager to encapsulate Git-related operations
- Update extension.ts to use new manager classes
- Improve error handling and logging across components
- Add comprehensive TypeScript type definitions for Git extension API
- Include interfaces for Repository, Branch, Commit and Remote operations
- Define enums for ForcePushMode, RefType, Status and GitErrorCodes
- Add types for credentials, remote sources and branch protection
- Include interfaces for various providers and handlers
- Add type definitions for Git extension API versioning
- Add newlines between error message titles and details
- Update test cases to reflect new error message format
- Fix spelling of 'Unauthorized' to 'Unauthorised' in test description
- Maintain consistent error message formatting across all error handlers
…ce usage

- Replace wildcard import with specific named imports
- Import `ExtensionContext` and `window` directly from vscode
- Remove redundant `vscode` namespace references throughout the file
- Update type annotations to use imported types
- Replace full vscode import with specific window import
- Add type-only import for CommitConfig
- Simplify commit message processing by combining regex replacements
- Improve error message formatting for better readability
- Remove redundant comment and code duplication
- Clean up string template handling for error messages
…ace usage

- Import only required workspace module from vscode
- Reorder CommitConfig interface properties alphabetically
- Reorder ConfigManager static properties alphabetically
- Simplify config retrieval using destructured workspace import
- Use specific imports from vscode instead of importing entire namespace
- Add proper type annotation for GitExtension
- Remove redundant type annotations for class methods
- Clean up return type declarations
…e formatting

- Replace wildcard import with specific named imports
- Add explicit type imports for ExtensionContext and TextDocument
- Improve error message formatting with newlines for better readability
- Remove redundant string concatenation in error logging
@tsdevau tsdevau self-assigned this Oct 25, 2024
@tsdevau tsdevau added the enhancement New feature or request label Oct 25, 2024
@tsdevau tsdevau merged commit 531b971 into main Oct 25, 2024
3 checks passed
@tsdevau tsdevau deleted the abstraction branch October 25, 2024 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants