-
Notifications
You must be signed in to change notification settings - Fork 1
merge(abstraction): abstract extension to components #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.