Skip to content

Commit aa8194f

Browse files
committed
Enhance classes XML documentation
1 parent c68d2b5 commit aa8194f

21 files changed

Lines changed: 707 additions & 235 deletions

src/NetContextClient/Models/AddIgnorePatternsResponse.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class AddIgnorePatternsResponse : IgnorePatternsResponse
77
{
8+
/// <summary>
9+
/// Gets or sets the array of glob patterns that were successfully added to the ignore list.
10+
/// </summary>
811
public string[] ValidPatternsAdded { get; set; } = [];
912

13+
/// <summary>
14+
/// Gets or sets the array of patterns that were rejected due to invalid glob syntax or other validation errors.
15+
/// </summary>
1016
public string[] InvalidPatterns { get; set; } = [];
1117
}

src/NetContextClient/Models/IgnorePatternsResponse.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class IgnorePatternsResponse
77
{
8+
/// <summary>
9+
/// Gets or sets the built-in default glob patterns used for file exclusion.
10+
/// </summary>
811
public string[] DefaultPatterns { get; set; } = [];
912

13+
/// <summary>
14+
/// Gets or sets the user-defined glob patterns used for file exclusion.
15+
/// </summary>
1016
public string[] UserPatterns { get; set; } = [];
1117

18+
/// <summary>
19+
/// Gets or sets the combined list of both default and user-defined glob patterns.
20+
/// </summary>
1221
public string[] AllPatterns { get; set; } = [];
1322
}

src/NetContextClient/Models/PackageAnalysis.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,48 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class PackageAnalysis
77
{
8+
/// <summary>
9+
/// Gets or sets the NuGet package identifier.
10+
/// </summary>
811
public string PackageId { get; set; } = "";
912

13+
/// <summary>
14+
/// Gets or sets the current version of the package installed in the project.
15+
/// </summary>
1016
public string Version { get; set; } = "";
1117

18+
/// <summary>
19+
/// Gets or sets a value indicating whether the package is actively used in the project.
20+
/// </summary>
1221
public bool IsUsed { get; set; }
1322

23+
/// <summary>
24+
/// Gets or sets the list of file paths where the package is referenced or used.
25+
/// </summary>
1426
public List<string> UsageLocations { get; set; } = [];
1527

28+
/// <summary>
29+
/// Gets or sets the latest available version of the package, if an update is available.
30+
/// </summary>
1631
public string? LatestVersion { get; set; }
1732

33+
/// <summary>
34+
/// Gets or sets a value indicating whether the package has known security vulnerabilities.
35+
/// </summary>
1836
public bool HasSecurityIssues { get; set; }
1937

38+
/// <summary>
39+
/// Gets or sets the recommended action to take regarding this package (e.g., update, remove, etc.).
40+
/// </summary>
2041
public string? RecommendedAction { get; set; }
2142

43+
/// <summary>
44+
/// Gets or sets a value indicating whether a newer version of the package is available.
45+
/// </summary>
2246
public bool HasUpdate { get; set; }
2347

48+
/// <summary>
49+
/// Gets or sets the list of packages that depend on this package.
50+
/// </summary>
2451
public List<string> TransitiveDependencies { get; set; } = [];
2552
}

src/NetContextClient/Models/ProjectPackageAnalysis.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class ProjectPackageAnalysis
77
{
8+
/// <summary>
9+
/// Gets or sets the path to the project file being analyzed.
10+
/// </summary>
811
public string ProjectPath { get; set; } = string.Empty;
912

13+
/// <summary>
14+
/// Gets or sets the list of package analysis results for this project.
15+
/// </summary>
1016
public List<PackageAnalysis> Packages { get; set; } = [];
1117
}

src/NetContextClient/Models/RemoveIgnorePatternsResponse.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class RemoveIgnorePatternsResponse : IgnorePatternsResponse
77
{
8+
/// <summary>
9+
/// Gets or sets the array of patterns that were successfully removed from the ignore list.
10+
/// </summary>
811
public string[] RemovedPatterns { get; set; } = [];
912

13+
/// <summary>
14+
/// Gets or sets the array of patterns that were not found in the ignore list.
15+
/// </summary>
1016
public string[] NotFoundPatterns { get; set; } = [];
1117

18+
/// <summary>
19+
/// Gets or sets the array of default patterns that could not be removed as they are system-defined.
20+
/// </summary>
1221
public string[] DefaultPatternsSkipped { get; set; } = [];
1322
}

src/NetContextClient/Models/SemanticSearchResponse.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class SemanticSearchResponse
77
{
8+
/// <summary>
9+
/// Gets or sets the array of semantic search results ordered by relevance.
10+
/// </summary>
811
public SemanticSearchResult[] Results { get; set; } = [];
912
}

src/NetContextClient/Models/SemanticSearchResult.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,33 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class SemanticSearchResult
77
{
8+
/// <summary>
9+
/// Gets or sets the file path where the search result was found.
10+
/// </summary>
811
public string FilePath { get; set; } = string.Empty;
912

13+
/// <summary>
14+
/// Gets or sets the starting line number of the result in the file (1-based).
15+
/// </summary>
1016
public int StartLine { get; set; }
1117

18+
/// <summary>
19+
/// Gets or sets the ending line number of the result in the file (1-based).
20+
/// </summary>
1221
public int EndLine { get; set; }
1322

23+
/// <summary>
24+
/// Gets or sets the matched content from the file.
25+
/// </summary>
1426
public string Content { get; set; } = string.Empty;
1527

28+
/// <summary>
29+
/// Gets or sets the semantic similarity score of the result (higher is better).
30+
/// </summary>
1631
public float Score { get; set; }
1732

33+
/// <summary>
34+
/// Gets or sets the parent scope (e.g., namespace, class, or method) containing this result.
35+
/// </summary>
1836
public string ParentScope { get; set; } = string.Empty;
1937
}

src/NetContextClient/Models/StateFileLocationResponse.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ namespace NetContextClient.Models;
55
/// </summary>
66
public class StateFileLocationResponse
77
{
8+
/// <summary>
9+
/// Gets or sets the absolute path to the state file used for storing persistent configuration.
10+
/// </summary>
811
public string StateFilePath { get; set; } = string.Empty;
912
}

src/NetContextServer/Extensions/StringExtensions.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
namespace NetContextServer.Extensions;
22

3+
/// <summary>
4+
/// Provides extension methods for string manipulation and code content formatting.
5+
/// </summary>
36
internal static class StringExtensions
47
{
8+
/// <summary>
9+
/// Extracts a name from a line of code following a specified keyword.
10+
/// </summary>
11+
/// <param name="line">The line of code to analyze.</param>
12+
/// <param name="keyword">The keyword that precedes the name to extract.</param>
13+
/// <returns>The extracted name, or an empty string if no name is found.</returns>
14+
/// <remarks>
15+
/// The method looks for the first occurrence of the keyword followed by a space,
16+
/// then extracts the text until it encounters a space, opening brace, colon, or parenthesis.
17+
/// </remarks>
518
public static string ExtractName(string line, string keyword)
619
{
720
int keywordIndex = line.IndexOf(keyword + " ");
@@ -30,6 +43,15 @@ public static string ExtractName(string line, string keyword)
3043
return string.Empty;
3144
}
3245

46+
/// <summary>
47+
/// Extracts a method name from a line of code.
48+
/// </summary>
49+
/// <param name="line">The line of code containing the method declaration.</param>
50+
/// <returns>The extracted method name, or an empty string if no method name is found.</returns>
51+
/// <remarks>
52+
/// The method extracts the text between the last space and the opening parenthesis
53+
/// in the line, which typically represents the method name in a method declaration.
54+
/// </remarks>
3355
public static string ExtractMethodName(string line)
3456
{
3557
// Extract the method name from the line (text before the opening parenthesis)
@@ -50,6 +72,20 @@ public static string ExtractMethodName(string line)
5072
return string.Empty;
5173
}
5274

75+
/// <summary>
76+
/// Formats code content by managing blank lines and structural elements for improved readability.
77+
/// </summary>
78+
/// <param name="content">The code content to format.</param>
79+
/// <returns>The formatted code content with optimized blank line placement.</returns>
80+
/// <remarks>
81+
/// This method performs the following formatting operations:
82+
/// <list type="bullet">
83+
/// <item><description>Removes excessive blank lines</description></item>
84+
/// <item><description>Ensures proper structure with opening/closing braces</description></item>
85+
/// <item><description>Adds strategic blank lines before significant declarations</description></item>
86+
/// <item><description>Maintains a maximum ratio of 25% blank lines</description></item>
87+
/// </list>
88+
/// </remarks>
5389
public static string FormatCodeContent(string content)
5490
{
5591
// First, remove all blank lines completely
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
namespace NetContextServer.Models;
22

3+
/// <summary>
4+
/// Represents a snippet of code from a source file with its associated metadata and embedding.
5+
/// </summary>
36
public class CodeSnippet
47
{
8+
/// <summary>
9+
/// Gets the full file path of the source code file.
10+
/// </summary>
511
public required string FilePath { get; init; }
612

13+
/// <summary>
14+
/// Gets the actual content/text of the code snippet.
15+
/// </summary>
716
public required string Content { get; init; }
817

18+
/// <summary>
19+
/// Gets the starting line number of the snippet in the source file (1-based).
20+
/// </summary>
921
public required int StartLine { get; init; }
1022

23+
/// <summary>
24+
/// Gets the ending line number of the snippet in the source file (1-based).
25+
/// </summary>
1126
public required int EndLine { get; init; }
1227

28+
/// <summary>
29+
/// Gets the vector embedding representation of the code snippet used for semantic search.
30+
/// </summary>
1331
public required ReadOnlyMemory<float> Embedding { get; init; }
1432
}

0 commit comments

Comments
 (0)