-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add VS Code Language Model API integration and Biome linting #43
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
- Add VsCodeLlmService class implementing AIService interface - Integrate VS Code's built-in Language Model API (GitHub Copilot) - Add configuration options for aiServiceProvider and vscodeLmModel - Support both OpenAI API and VS Code LM API as AI service providers - Implement caching and error handling for LLM requests - Update Diffy class to use selected AI service provider
- Fix singleton constructor pattern in OpenAiService and WorkspaceService - Use type imports for better tree-shaking - Improve code formatting and consistency - Fix unused variable warnings (_gitCmd prefix) - Simplify conditional expressions with optional chaining
- Change void[] to undefined[] in EventEmitter to fix confusing void type - Improve formatting consistency in type definitions - Fix trailing comma formatting in git.d.ts interfaces
- Use node:path and node:assert imports with node: protocol - Update code formatting to match project style (2 spaces, double quotes) - Remove unused error parameter in catch block - Improve code consistency across test files
- Format VS Code launch and tasks config files - Use node: protocol in webpack.config.js - Improve JSON formatting consistency (arrays, indentation) - Fix trailing comma issues
- Add documentation for dual AI provider support (OpenAI and GitHub Copilot) - Update configuration instructions for both providers - Add note about GitHub Copilot subscription requirement - Improve formatting and clarity of setup instructions
- Minor version bump for VS Code Language Model integration feature - Adds dual AI provider support (OpenAI and GitHub Copilot)
- Document VS Code Language Model API integration - List new configuration options for AI provider selection - Note improvements to singleton patterns and type safety - Add documentation updates section
- Remove .prettierrc configuration file - Set Biome as default formatter in VS Code settings - Enable format on save with Biome
- Normalize line endings and formatting across project - Format configuration files (.biomeignore, workflows, VS Code settings) - Format documentation files (README, CHANGELOG) - Ensure consistent code style throughout codebase
- Add explicit permissions block with 'contents: read' - Follow principle of least privilege for workflow security - Prevents unnecessary token access to repository resources
- Replace .then().catch() with try/catch in OpenAiService for cleaner async handling - Make VS Code command handlers async and await promises to prevent unhandled rejections - Ensure all async operations are properly awaited in command handlers - Improve error handling consistency across services
- Remove deprecated activationEvents (auto-generated by VS Code) - Use type-only imports in git.d.ts for better tree-shaking - Fix unused expression in GitService.ts (convert ternary to if-else) - Verify all VS Code Language Model API calls are compatible with v1.90.0
- Replace 'any' with 'unknown' in catch blocks for safer error handling - Add proper type guards for error handling in VsCodeLlmService and OpenAiService - Update CacheService to use specific types (string | OpenAI.Chat.Completions.ChatCompletion) - Replace 'any' type for _windowsService with WindowService | null - Improve type safety across the codebase following TypeScript best practices
- Make constructors private to enforce singleton pattern - Remove conditional logic from constructors that could skip initialization - Remove definite assignment assertions (!) and use proper initialization - Apply consistent singleton pattern across services - Ensures all properties are always initialized correctly
- Fix Mocha constructor usage with proper type casting - Add explicit type annotations for callback parameters - Remove unused variable in OpenAiService - Ensure proper return types for Promise callbacks - Fix glob import to use named import syntax
- Use TypeScript import = require syntax for CommonJS Mocha module - Remove unsafe any type casting for Mocha constructor - Maintains full type safety while working with CommonJS exports - Based on Mocha documentation and best practices
- Replace unsafe 'as Error' cast with proper type guard - Enable noImplicitReturns and useUnknownInCatchVariables for stricter type checking - Fixes TypeScript ESLint prefer-promise-reject-errors rule compliance
- Convert async command handlers to synchronous functions returning promises directly - Eliminates 'async arrow function has no await expression' linting errors - Maintains VS Code command handler compatibility (accepts Promise<void> or void) - Keep async/await for generateCommitMessage due to withProgress complexity
- Add file exclusion patterns to filter irrelevant files from diff analysis - Implement customizable commit message formats (conventional/gitmoji) - Add configurable commit body inclusion with detailed explanations - Add maximum subject line length configuration (50-200 chars) - Enhance VsCodeLlmService with dynamic prompt generation based on settings - Implement smart diff filtering in GitService to reduce token usage - Add comprehensive configuration options in WorkspaceService - Update README with advanced configuration documentation This improves commit message quality by: - Filtering out lock files, images, and generated files automatically - Supporting team-specific commit conventions - Reducing AI token usage through intelligent file selection - Providing consistent formatting following Conventional Commits spec
…ng or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ntation - Add release.yml workflow for automated extension publishing - Implement intelligent version bumping based on conventional commits - Auto-generate categorized release notes - Create GitHub releases with VSIX artifacts - Add comprehensive release documentation (RELEASE.md) - Add quick release guide for maintainers - Update .gitignore to exclude macOS and editor files - Update README with contributing section
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.
Summary
This PR adds support for VS Code's Language Model API (GitHub Copilot) as an alternative AI provider and migrates the project from ESLint to Biome for faster linting and formatting.
Features
VS Code Language Model Integration
aiServiceProvider: Choose betweenopenaiorvscode-lmvscodeLmModel: Select betweencopilot-gpt-4oorcopilot-gpt-3.5-turboBiome Migration
Changes
Added
src/service/VsCodeLlmService.ts- VS Code LLM service implementationChanged
node:protocolRemoved
.eslintrc.jsonVersion
Testing
Documentation
Breaking Changes
None - fully backward compatible. OpenAI remains the default provider.
Dependencies
@biomejs/biome(2.3.2)@types/vscode(^1.105.0)Closes #