feat: Add configuration parameters#14
Merged
Merged
Conversation
…sion Signed-off-by: GitHub <noreply@github.com>
…guration Signed-off-by: GitHub <noreply@github.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a centralized configuration management system for the cognitive complexity extension, improving type safety, maintainability, and testability of configuration handling.
- Adds
ConfigurationManagerclass with type-safe access to extension settings and validation - Refactors
ComplexityCodeLensProviderto use centralized configuration management - Expands package.json with formal extension configuration schema for VS Code settings UI
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/configuration.ts | New configuration manager with type-safe access, validation, and change watching |
| src/providers/codeLensProvider.ts | Refactored to use ConfigurationManager instead of direct workspace configuration access |
| src/test/configuration.test.ts | Comprehensive test suite for configuration management functionality |
| src/test/providers/codeLensProvider.test.ts | Updated provider tests to mock ConfigurationManager |
| package.json | Added formal configuration schema for VS Code settings UI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
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.
This pull request introduces a centralized and type-safe configuration management system for the cognitive complexity extension, replacing scattered configuration access with a dedicated
ConfigurationManager. It updates the code lens provider to use this manager for all settings, adds comprehensive unit tests for configuration logic, and exposes new extension settings inpackage.json. These changes make configuration handling more robust, maintainable, and testable.Configuration Management Enhancements:
ConfigurationManagerclass insrc/configuration.tsthat centralizes access to all extension settings, provides type safety, default values, validation, and change watching.package.jsonto formally declare all cognitive complexity settings (enable/disable, CodeLens toggle, warning/error thresholds, exclusion patterns) for user configurability in VS Code.Provider Refactoring:
ComplexityCodeLensProviderinsrc/providers/codeLensProvider.tsto useConfigurationManagerfor all configuration access, including thresholds and exclusion patterns, and to determine status icons/text. [1] [2] [3] [4] [5]Testing Improvements:
src/test/configuration.test.tswith comprehensive unit tests for configuration loading, validation, status calculation, and change watching.src/test/providers/codeLensProvider.test.tsto mock and verify configuration handling via the new manager. [1] [2]