Skip to content

Conversation

@d1820
Copy link
Owner

@d1820 d1820 commented Nov 18, 2025

This pull request refactors the analyzer classes in the CodeDocumentor.Analyzers project to improve code organization and maintainability. The main changes include moving all analyzer-related classes into a dedicated Analyzers subnamespace and updating their dependencies to use shared helpers and locators from the CodeDocumentor.Common namespace.

Namespace restructuring:

  • Moved all analyzer classes (such as ClassAnalyzer, ConstructorAnalyzer, EnumAnalyzer, FieldAnalyzer, FileAnalyzer, InterfaceAnalyzer, MethodAnalyzer, and PropertyAnalyzer) and their respective settings and non-public variants into the CodeDocumentor.Analyzers.Analyzers namespace and its subnamespaces (e.g., Classes, Constructors, Enums, etc.), improving codebase structure and discoverability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Dependency updates:

  • Changed imports in all analyzer files to use CodeDocumentor.Common.Helper and CodeDocumentor.Common.Locators instead of their previous local versions, centralizing shared logic and reducing code duplication. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Settings class updates:

  • Updated the namespaces for all analyzer settings classes (such as ClassAnalyzerSettings, ConstructorAnalyzerSettings, EnumAnalyzerSettings, FieldAnalyzerSettings, FileAnalyzerSettings, InterfaceAnalyzerSettings, MethodAnalyzerSettings) to match the new structure under CodeDocumentor.Analyzers.Analyzers. [1] [2] [3] [4] [5] [6] [7]

Base class and interface updates:

  • Updated the BaseAnalyzerSettings class to reside in the new CodeDocumentor.Analyzers.Analyzers namespace and to use the shared locator from CodeDocumentor.Common.Locators.

These changes help standardize the analyzer code structure, making it easier to maintain and extend in the future.

d1820 added 23 commits November 15, 2025 07:28
Replaced FluentAssertions with Shouldly across test files.
Updated test-related NuGet packages and added Shouldly.
Introduced a new Visual Studio extension project, CodeDocumentor2026.
Updated the solution file to include the new project.
Removed a namespace declaration from ProtoTesterBracketNamespace.cs.
Refactor namespaces to include an additional `Analyzers` segment,
affecting multiple files. Update `ServiceLocator` to use a new
`SettingService` with `IEventLogger` dependency, and move
`SettingService` to `CodeDocumentor.Common.Services`.

Modify project files to reflect structural changes, removing the
old `SettingService.cs` and adding new command files. Add new
command handlers for Visual Studio extension, integrated via
`CodeDocumentor2026Package.vsct`.

Update unit tests to align with namespace changes. Add a new
VSCT file to define command layouts. Include miscellaneous
improvements like new using directives and code cleanup.
Updated `TestFixture.cs` to use `CodeDocumentor.Common.Services` and added `Moq` for mocking `IEventLogger`. Refactored `Initialize` method to use dependency injection for `SettingService`.

Removed `GetFixAllProvider` from `BaseCodeFixProvider.cs` and adjusted debug logic to include an `#else` block for document processing.

Simplified `FileCodeFixProvider.cs` by removing unused `using` directives, the `Title` constant, and `FixableDiagnosticIds`. Streamlined `RegisterCodeFixesAsync` to delegate to `RegisterFileCodeFixesAsync`.

Overall, these changes enhance code maintainability by reducing redundancy and improving service initialization.
Refactor the codebase to improve modularity and maintainability by moving classes and methods to the `CodeDocumentor.Common` namespace. Introduce `CommentBuilderService` to centralize comment-building logic, enhancing separation of concerns and reusability.

Add a new `Logger` class for structured logging and an `OptionPageGrid` class for managing configuration options within the Visual Studio extension. Update project files to include new dependencies and metadata, and remove outdated scripts, aligning with modern development practices.

Enhance branding with the addition of a new logo.
Enabled assembly signing in `CodeDocumentor2026.csproj` and added necessary references for improved build configuration. Reorganized project items, including the addition of `CodeDocumentor2026Package.cs` and `VSPackage.resx`, to streamline initialization and service registration processes. Updated `CodeDocumentor2026Package.vsct` to define new GUIDs and command IDs, and ensured consistent logging in `Logger.cs`. Changed `PackageGuidString` in `VsixOptions.cs` and updated `source.extension.vsixmanifest` with a new dependency. Likely updated `CodeDocumentor2026Package.ico` to enhance the extension's visual branding.
Consolidated `CodeDocumentorFileCommand` and `CodeDocumentorFolderCommand` into a unified `CodeDocumentorContextCommand` class. Updated `CodeDocumentor2026.csproj` to reflect these changes by removing old references and adding the new one. Modified `CodeDocumentor2026Package.cs` to initialize the new context command. This refactoring reduces redundancy and simplifies maintenance by combining similar logic into a single class, while maintaining detailed logging for debugging.
Added `GetDocumentationLineCount` to `ICommentBuilderService` for counting non-empty XML doc lines. Updated `CommentBuilderService.cs` to implement this method and added necessary using directives. Modified `CodeDocumentor2026Package.vsct` to adjust menu priorities and button text, introducing a new command ID for whole file documentation. Enhanced `CodeDocumentorEditorCommand.cs` to support whole file documentation, refactored node finding logic, and extracted document update logic. Updated `TextSelectionExecutor.cs` with a new parameter for improved text handling. Added `GlobalSuppressions.cs` for code analysis management and `TextSelectionExtensions.cs` for cursor positioning.
Updated the priority of context menu groups in `CodeDocumentor2026Package.vsct` to `0x0100` for better menu organization. Added a new button for the editor context menu to provide a "Code Documentor This" option. Adjusted the priority of the "Code Documentor File" button. Introduced commented-out Quick Actions and Refactorings menu groups and buttons for future XML documentation features. Added new constants and command service entries in `CodeDocumentorEditorCommand.cs` for Quick Actions, enhancing command execution logic to support these new features.
Introduce `Settings2026` class implementing `IBaseSettings`, replacing `Settings` and `ISettings` across the codebase. Update `GetSettingsFilePath` to handle "2026" settings. Refactor `ICommentBuilderService` and `CommentBuilderService` to use `IBaseSettings`. Update `CodeDocumentor2026Package` and `OptionPageGrid` for compatibility with new settings. Move `Logger` to `CodeDocumentor2026` namespace. Add `Settings2026.cs` with methods for managing 2026-specific settings. Improve code readability by removing unnecessary whitespace in command classes.
@d1820 d1820 merged commit 27656d7 into main Nov 18, 2025
1 check 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.

1 participant