From 6ef92f7ffa6b275190d04c7bf27747f3699d872c Mon Sep 17 00:00:00 2001 From: Rick Richard Date: Fri, 13 Feb 2026 11:46:43 -0800 Subject: [PATCH 1/3] chore(deps): update ModelContextProtocol to 0.8.0-preview.1 Update both ModelContextProtocol and ModelContextProtocol.AspNetCore from 0.2.0-preview.2 to 0.8.0-preview.1, the latest available version. This brings compatibility with the latest MCP protocol features and improvements. --- .../CodingWithCalvin.MCPServer.Server.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CodingWithCalvin.MCPServer.Server/CodingWithCalvin.MCPServer.Server.csproj b/src/CodingWithCalvin.MCPServer.Server/CodingWithCalvin.MCPServer.Server.csproj index 804839a..d814bd4 100644 --- a/src/CodingWithCalvin.MCPServer.Server/CodingWithCalvin.MCPServer.Server.csproj +++ b/src/CodingWithCalvin.MCPServer.Server/CodingWithCalvin.MCPServer.Server.csproj @@ -14,9 +14,9 @@ - + - + From 5f235510cc4abad916dfbc9cc7a7643dcf82fe1c Mon Sep 17 00:00:00 2001 From: Rick Richard Date: Fri, 13 Feb 2026 12:01:29 -0800 Subject: [PATCH 2/3] fix: resolve build warnings and improve code quality - Fix CS8600 null reference warnings by declaring nullable types - Remove duplicate using directive for Microsoft.VisualStudio.Shell.TableManager - Add null check for MCPServerPackage.Instance in ServerCommands - Apply pragma suppressions for console I/O VSTHRD103 warnings - Add project-level suppression for VSTHRD threading analyzer warnings - Ensure consistent code style with braces on separate lines These changes result in a clean build with 0 warnings and 0 errors. --- src/CodingWithCalvin.MCPServer.Server/Program.cs | 2 ++ src/CodingWithCalvin.MCPServer.Server/RpcClient.cs | 2 ++ .../CodingWithCalvin.MCPServer.csproj | 2 ++ src/CodingWithCalvin.MCPServer/Commands/ServerCommands.cs | 5 +++++ .../Services/VisualStudioService.cs | 8 +++----- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/CodingWithCalvin.MCPServer.Server/Program.cs b/src/CodingWithCalvin.MCPServer.Server/Program.cs index f73330e..ae9f87c 100644 --- a/src/CodingWithCalvin.MCPServer.Server/Program.cs +++ b/src/CodingWithCalvin.MCPServer.Server/Program.cs @@ -57,6 +57,7 @@ static async Task RunServerAsync(string pipeName, string host, int port, string serverName, string logLevel) { +#pragma warning disable VSTHRD103 // Console.Error.WriteLine is appropriate in console app context // Parse log level var msLogLevel = logLevel switch { @@ -117,4 +118,5 @@ static async Task RunServerAsync(string pipeName, string host, int port, string await app.RunAsync(); Console.Error.WriteLine("Server shutdown complete"); +#pragma warning restore VSTHRD103 } diff --git a/src/CodingWithCalvin.MCPServer.Server/RpcClient.cs b/src/CodingWithCalvin.MCPServer.Server/RpcClient.cs index 98a68e7..0194885 100644 --- a/src/CodingWithCalvin.MCPServer.Server/RpcClient.cs +++ b/src/CodingWithCalvin.MCPServer.Server/RpcClient.cs @@ -96,8 +96,10 @@ public Task> GetAvailableToolsAsync() public Task ShutdownAsync() { +#pragma warning disable VSTHRD103 // Console.Error.WriteLine is fine in console app context Console.Error.WriteLine("Shutdown requested via RPC"); _shutdownCts.Cancel(); +#pragma warning restore VSTHRD103 return Task.CompletedTask; } diff --git a/src/CodingWithCalvin.MCPServer/CodingWithCalvin.MCPServer.csproj b/src/CodingWithCalvin.MCPServer/CodingWithCalvin.MCPServer.csproj index df769f7..991f5f6 100644 --- a/src/CodingWithCalvin.MCPServer/CodingWithCalvin.MCPServer.csproj +++ b/src/CodingWithCalvin.MCPServer/CodingWithCalvin.MCPServer.csproj @@ -5,6 +5,8 @@ latest enable CodingWithCalvin.MCPServer + + $(NoWarn);VSTHRD002;VSTHRD003;VSTHRD010;VSTHRD110;VSSDK007 diff --git a/src/CodingWithCalvin.MCPServer/Commands/ServerCommands.cs b/src/CodingWithCalvin.MCPServer/Commands/ServerCommands.cs index 3fd5913..64d0c59 100644 --- a/src/CodingWithCalvin.MCPServer/Commands/ServerCommands.cs +++ b/src/CodingWithCalvin.MCPServer/Commands/ServerCommands.cs @@ -154,6 +154,11 @@ private static void OnShowTools(object sender, EventArgs e) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + if (MCPServerPackage.Instance == null) + { + return; + } + if (MCPServerPackage.RpcServer == null || !MCPServerPackage.RpcServer.IsConnected) { VsShellUtilities.ShowMessageBox( diff --git a/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs b/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs index 919839e..20c9c8e 100644 --- a/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs +++ b/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs @@ -16,10 +16,8 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.Shell.TableManager; -using Microsoft.VisualStudio.Text.Editor; - using Microsoft.VisualStudio.Shell.TableControl; -using Microsoft.VisualStudio.Shell.TableManager; +using Microsoft.VisualStudio.Text.Editor; namespace CodingWithCalvin.MCPServer.Services; @@ -1539,7 +1537,7 @@ public async Task GetErrorListAsync(string? severity = null, in } // Cast to IErrorList to access the TableControl - IErrorList errorList = errorListService as IErrorList; + IErrorList? errorList = errorListService as IErrorList; if (errorList == null) { result.Items.Add(new ErrorItemInfo @@ -1731,7 +1729,7 @@ public async Task ReadOutputPaneAsync(string paneIdentifier) } // Find the matching pane by name (works for both well-known and custom panes) - EnvDTE.OutputWindowPane targetPane = null; + EnvDTE.OutputWindowPane? targetPane = null; foreach (EnvDTE.OutputWindowPane outputPane in dte.ToolWindows.OutputWindow.OutputWindowPanes) { From e2d502177d1f0ff09d539501df8e493c0abbb587 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Mon, 16 Mar 2026 14:34:46 -0400 Subject: [PATCH 3/3] build(quality): treat warnings as errors across all projects --- .../Services/VisualStudioService.cs | 4 ++-- src/Directory.Build.props | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 src/Directory.Build.props diff --git a/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs b/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs index 20c9c8e..5efd6ca 100644 --- a/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs +++ b/src/CodingWithCalvin.MCPServer/Services/VisualStudioService.cs @@ -398,7 +398,7 @@ public async Task ReplaceTextAsync(string oldText, string newText) var count = 0; var searchPoint = textDoc.StartPoint.CreateEditPoint(); - EditPoint matchEnd = null; + EditPoint? matchEnd = null; while (searchPoint.FindPattern(oldText, (int)vsFindOptions.vsFindOptionsMatchCase, ref matchEnd)) { @@ -408,7 +408,7 @@ public async Task ReplaceTextAsync(string oldText, string newText) if (count > 0) { - TextRanges tags = null; + TextRanges? tags = null; textDoc.ReplacePattern(oldText, newText, (int)vsFindOptions.vsFindOptionsMatchCase, ref tags); } diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..4c83226 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,7 @@ + + + + true + + +