-
Notifications
You must be signed in to change notification settings - Fork 6
Bug fixes #40
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for storing CodeDocumentor settings in .editorconfig files, allowing the extension to decouple from Visual Studio's dependency injection system. It also includes several architectural improvements to modernize the codebase.
- Adds .editorconfig support for extension settings, enabling out-of-process execution
- Rewrites settings management to remove dependency injection and static access patterns
- Modernizes the codebase by extracting common functionality and removing redundant code
Reviewed Changes
Copilot reviewed 109 out of 110 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| TestProject/Sample/.editorconfig | Adds new .editorconfig file with CodeDocumentor-specific settings |
| TestProject/Sample/Sample.sln | Updates solution file to include .editorconfig as a solution item |
| Readme.md | Updates documentation to describe .editorconfig support and known issues |
| CodeDocumentor/Settings/VsixOptions.cs | Updates version number and removes namespace dependency |
| CodeDocumentor/Models/OptionPageGrid.cs | Enhances options page to support .editorconfig conversion and settings decoupling |
| CodeDocumentor/CodeDocumentor.Package.cs | Removes dependency injection container and updates initialization |
| CodeDocumentor/Helper/* | Multiple helper classes updated to support new settings architecture |
| CodeDocumentor/Analyzers/* | All analyzers updated to use new settings system instead of DI |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| namespace Sample.CodeDocumentor | ||
| { | ||
|
|
||
| public interface ITestPublicInteraceMethods |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface name contains a typo: 'Interace' should be 'Interface'. It should be 'ITestPublicInterfaceMethods'.
| public interface ITestPublicInteraceMethods | |
| public interface ITestPublicInterfaceMethods |
| - As of VS2022 verison 17.6.x there is some bug that makes extension analyzers not being to work work properly if you have *Run code analysis in seperate process* | ||
| Microsoft is not going to make any changes to truly allow analyzers to run out of process. Even with .editorconfig support, it will not work if you want to have any user level settings collection from Visual Studio > Options. | ||
|
|
||
| - As of VS2022 version 17.6.x there is some bug that makes extension analyzers not being to work work properly if you have *Run code analysis in seperate process* |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are spelling errors: 'seperate' should be 'separate' and 'not being to work work' should be 'not being able to work'.
| - As of VS2022 version 17.6.x there is some bug that makes extension analyzers not being to work work properly if you have *Run code analysis in seperate process* | |
| - As of VS2022 version 17.6.x there is some bug that makes extension analyzers not being able to work properly if you have *Run code analysis in separate process* |
| This will convert the existing Visual Studio Option Settings to editor config format and copy them to your clipboard. | ||
| Paste this into a new or existing .editorconfig file in your solution. | ||
|
|
||
| **NOTE**: Event with using .editroconfig as your settings, Out of Process still can not be used, because the extension needs to support backward compatibility of using the Visual Studio Options. |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are spelling errors: 'Event' should be 'Even' and '.editroconfig' should be '.editorconfig'.
| **NOTE**: Event with using .editroconfig as your settings, Out of Process still can not be used, because the extension needs to support backward compatibility of using the Visual Studio Options. | |
| **NOTE**: Even with using .editorconfig as your settings, Out of Process still can not be used, because the extension needs to support backward compatibility of using the Visual Studio Options. |
| private static bool ConvertToBoolean(this AnalyzerConfigOptions options, string key, bool defaulBool) | ||
| { | ||
| options.TryGetValue(key, out var cds); | ||
| if (string.IsNullOrEmpty(cds)) | ||
| { | ||
| return defaulBool; | ||
| } | ||
| if (bool.TryParse(cds, out var converted)) | ||
| { | ||
| return converted; | ||
| } | ||
| return defaulBool; |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter name has a typo: 'defaulBool' should be 'defaultBool'.
| private static bool ConvertToBoolean(this AnalyzerConfigOptions options, string key, bool defaulBool) | |
| { | |
| options.TryGetValue(key, out var cds); | |
| if (string.IsNullOrEmpty(cds)) | |
| { | |
| return defaulBool; | |
| } | |
| if (bool.TryParse(cds, out var converted)) | |
| { | |
| return converted; | |
| } | |
| return defaulBool; | |
| private static bool ConvertToBoolean(this AnalyzerConfigOptions options, string key, bool defaultBool) | |
| { | |
| options.TryGetValue(key, out var cds); | |
| if (string.IsNullOrEmpty(cds)) | |
| { | |
| return defaultBool; | |
| } | |
| if (bool.TryParse(cds, out var converted)) | |
| { | |
| return converted; | |
| } | |
| return defaultBool; |
| settings.IsEnabledForNonPublicFields = options.ConvertToBoolean("codedocumentor_is_enabled_for_non_public_fields", false); | ||
| settings.PreserveExistingSummaryText = options.ConvertToBoolean("codedocumentor_preserve_existing_summary_text", true); | ||
| settings.TryToIncludeCrefsForReturnTypes = options.ConvertToBoolean("codedocumentor_try_to_include_crefs_for_return_types", true); | ||
| settings.UseToDoCommentsOnSummaryError = options.ConvertToBoolean("codedocumentor_use_natural_language_for_return_node", false); |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same property 'UseToDoCommentsOnSummaryError' is being assigned twice. The first assignment should likely be to 'UseNaturalLanguageForReturnNode' property instead.
| settings.UseToDoCommentsOnSummaryError = options.ConvertToBoolean("codedocumentor_use_natural_language_for_return_node", false); | |
| settings.UseNaturalLanguageForReturnNode = options.ConvertToBoolean("codedocumentor_use_natural_language_for_return_node", false); |
| /// Gets or Sets the word maps. | ||
| /// </summary> | ||
| /// <value> Aa array of wordmaps. </value> | ||
| /// <value> An array of wordmaps. </value> |
Copilot
AI
Sep 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should be 'An array of word maps' (two words) for consistency with the rest of the codebase.
| /// <value> An array of wordmaps. </value> | |
| /// <value> An array of word maps. </value> |
d1820
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
Added .editorconfig support
Rewrote how settings are used, and decoupled entire extension from DI statics