Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions csharp-lsp-mcp/src/CSharpLspMcp/Tools/CSharpTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public Task<string> StopAsync(CancellationToken cancellationToken)
[Description("Get compiler errors and warnings for C# code. Opens the document in the LSP if not already open.")]
public Task<string> GetDiagnosticsAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("Content of the file (optional, reads from disk if not provided)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional, reads from disk if not provided)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_diagnostics", async ct =>
{
Expand Down Expand Up @@ -152,8 +152,8 @@ public Task<string> GetHoverAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("0-based line number")] int line,
[Description("0-based character position")] int character,
[Description("Content of the file (optional)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_hover", async ct =>
{
Expand All @@ -174,7 +174,7 @@ public Task<string> GetCompletionsAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("0-based line number")] int line,
[Description("0-based character position")] int character,
[Description("Content of the file (optional)")] string? content,
[Description("Content of the file (optional)")] string? content = null,
[Description("Maximum number of completions to return (default: 20)")] int maxResults = 20,
CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -211,8 +211,8 @@ public Task<string> GetDefinitionAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("0-based line number")] int line,
[Description("0-based character position")] int character,
[Description("Content of the file (optional)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_definition", async ct =>
{
Expand Down Expand Up @@ -243,7 +243,7 @@ public Task<string> GetReferencesAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("0-based line number")] int line,
[Description("0-based character position")] int character,
[Description("Content of the file (optional)")] string? content,
[Description("Content of the file (optional)")] string? content = null,
[Description("Include the declaration in results (default: true)")] bool includeDeclaration = true,
CancellationToken cancellationToken = default)
{
Expand Down Expand Up @@ -277,8 +277,8 @@ public Task<string> GetReferencesAsync(
[Description("Get all symbols (classes, methods, properties, etc.) in a document")]
public Task<string> GetSymbolsAsync(
[Description("Absolute path to the C# file")] string filePath,
[Description("Content of the file (optional)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_symbols", async ct =>
{
Expand Down Expand Up @@ -320,8 +320,8 @@ public Task<string> GetCodeActionsAsync(
[Description("0-based start character")] int startCharacter,
[Description("0-based end line")] int endLine,
[Description("0-based end character")] int endCharacter,
[Description("Content of the file (optional)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_code_actions", async ct =>
{
Expand Down Expand Up @@ -364,8 +364,8 @@ public Task<string> RenameAsync(
[Description("0-based line number")] int line,
[Description("0-based character position")] int character,
[Description("The new name for the symbol")] string newName,
[Description("Content of the file (optional)")] string? content,
CancellationToken cancellationToken)
[Description("Content of the file (optional)")] string? content = null,
CancellationToken cancellationToken = default)
{
return ExecuteToolAsync("csharp_rename", async ct =>
{
Expand Down