Skip to content

Commit ce41e66

Browse files
Clean up debugging output after fixing EditorConfig parsing bug
Co-authored-by: 304NotModified <5808377+304NotModified@users.noreply.github.com>
1 parent 9d0ae71 commit ce41e66

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

Reqnroll.VisualStudio/Editor/Commands/DefineStepsCommand.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ private void SaveAsStepDefinitionClass(IProjectScope projectScope, string combin
142142
var editorConfigOptions = _editorConfigOptionsProvider.GetEditorConfigOptions(textView);
143143
editorConfigOptions.UpdateFromEditorConfig(csharpConfig);
144144

145-
// Debug: Log the configuration values
146-
System.Diagnostics.Debug.WriteLine($"[DefineStepsCommand] NamespaceDeclarationStyle: '{csharpConfig.NamespaceDeclarationStyle}'");
147-
System.Diagnostics.Debug.WriteLine($"[DefineStepsCommand] UseFileScopedNamespaces: {csharpConfig.UseFileScopedNamespaces}");
148-
149145
// Build template with common structure
150146
var template = new StringBuilder();
151147
template.AppendLine("using System;");

Reqnroll.VisualStudio/Editor/Services/EditorConfig/EditorConfigOptions.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,13 @@ public EditorConfigOptions(DocumentOptionSet options)
1919

2020
public TResult GetOption<TResult>(string editorConfigKey, TResult defaultValue)
2121
{
22-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] GetOption: key='{editorConfigKey}', defaultValue='{defaultValue}', type={typeof(TResult).Name}");
23-
2422
if (_directEditorConfigValues.TryGetValue(editorConfigKey, out var simplifiedValue))
2523
{
26-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] Found value: '{simplifiedValue}' for key '{editorConfigKey}'");
2724
if (TryConvertFromString(simplifiedValue, defaultValue, out var convertedValue))
2825
{
29-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] Converted value: '{convertedValue}' for key '{editorConfigKey}'");
3026
return convertedValue;
3127
}
3228
}
33-
else
34-
{
35-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] No value found for key '{editorConfigKey}', returning default: '{defaultValue}'");
36-
}
3729
return defaultValue;
3830
}
3931

@@ -68,18 +60,7 @@ private Dictionary<string, string> ExtractEditorConfigValues()
6860
var dacOptionsField = optionsAnalyzerConfigOptions?.GetType()?.GetField("Options", BindingFlags.NonPublic | BindingFlags.Instance);
6961
var optionsCollection = dacOptionsField?.GetValue(optionsAnalyzerConfigOptions) as ImmutableDictionary<string, string>;
7062
if (optionsCollection != null)
71-
{
7263
values = new Dictionary<string, string>(optionsCollection);
73-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] Extracted {values.Count} EditorConfig values");
74-
foreach (var kvp in values)
75-
{
76-
System.Diagnostics.Debug.WriteLine($"[EditorConfigOptions] Key: '{kvp.Key}' = '{kvp.Value}'");
77-
}
78-
}
79-
else
80-
{
81-
System.Diagnostics.Debug.WriteLine("[EditorConfigOptions] No options collection found");
82-
}
8364
}
8465
catch (Exception ex)
8566
{

Reqnroll.VisualStudio/Editor/Services/EditorConfig/EditorConfigOptionsExtensions.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ public static void UpdateFromEditorConfig<TConfig>(this IEditorConfigOptions edi
2121
{
2222
if (config == null) throw new ArgumentNullException(nameof(config));
2323

24-
System.Diagnostics.Debug.WriteLine($"[UpdateFromEditorConfig] Updating configuration for type: {typeof(TConfig).Name}");
25-
2624
var propertiesWithEditorConfig = typeof(TConfig)
2725
.GetProperties(BindingFlags.Instance | BindingFlags.Public)
2826
.Select(p => new
@@ -36,22 +34,10 @@ public static void UpdateFromEditorConfig<TConfig>(this IEditorConfigOptions edi
3634
foreach (var property in propertiesWithEditorConfig)
3735
{
3836
var currentValue = property.PropertyInfo.GetValue(config);
39-
System.Diagnostics.Debug.WriteLine($"[UpdateFromEditorConfig] Property: {property.PropertyInfo.Name}, EditorConfigKey: {property.EditorConfigKey}, CurrentValue: {currentValue}");
40-
4137
var updatedValue = editorConfigOptions.GetOption(property.PropertyInfo.PropertyType,
4238
property.EditorConfigKey, currentValue);
43-
44-
System.Diagnostics.Debug.WriteLine($"[UpdateFromEditorConfig] UpdatedValue: {updatedValue}");
45-
4639
if (!Equals(currentValue, updatedValue))
47-
{
48-
System.Diagnostics.Debug.WriteLine($"[UpdateFromEditorConfig] Setting property {property.PropertyInfo.Name} from '{currentValue}' to '{updatedValue}'");
4940
property.PropertyInfo.SetValue(config, updatedValue);
50-
}
51-
else
52-
{
53-
System.Diagnostics.Debug.WriteLine($"[UpdateFromEditorConfig] Property {property.PropertyInfo.Name} unchanged: '{currentValue}'");
54-
}
5541
}
5642
}
5743
}

0 commit comments

Comments
 (0)