Skip to content

Commit 336ca02

Browse files
committed
fix: stop hot-spinning PumpAsync on partial residual frames; release 0.2.4
After TryReadFrame slices a frame off the buffer, the residual at [buffer.Start, buffer.End) has already been examined — TryReadFrame walked it to decide 'not enough yet'. Setting examined=buffer.Start makes the pipe return synchronously with the same bytes on the next ReadAsync, hot-spinning CPU until more data arrives. Matches Microsoft's documented Pipelines pattern (consumed=buffer.Start, examined=buffer.End). Bumps NuGet tool and plugin to 0.2.4.
1 parent 723d7cc commit 336ca02

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
33
"name": "claude-roslyn-lsp",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"description": "Roslyn LSP for Claude Code with solution/open injection",
66
"owner": { "name": "unsafePtr" },
77
"plugins": [
88
{
99
"name": "roslyn-lsp",
10-
"version": "0.2.3",
10+
"version": "0.2.4",
1111
"source": "./roslyn-lsp",
1212
"category": "development",
1313
"tags": ["csharp", "dotnet", "lsp", "roslyn"],

roslyn-lsp/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "roslyn-lsp",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Solution-aware Microsoft Roslyn LSP via ClaudeCodeRoslynLspProxy",
55
"author": { "name": "unsafePtr", "url": "https://github.com/unsafePtr" },
66
"homepage": "https://github.com/unsafePtr/ClaudeCodeRoslynLspProxy",

src/ClaudeCodeRoslynLspProxy/ClaudeCodeRoslynLspProxy.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackAsTool>true</PackAsTool>
1616
<ToolCommandName>ClaudeCodeRoslynLspProxy</ToolCommandName>
1717
<PackageId>ClaudeCodeRoslynLspProxy</PackageId>
18-
<Version>0.2.3</Version>
18+
<Version>0.2.4</Version>
1919
<Authors>unsafePtr</Authors>
2020
<Description>Thin LSP proxy that injects Roslyn's solution/open notification so Microsoft.CodeAnalysis.LanguageServer works as a solution-aware C# language server inside Claude Code.</Description>
2121
<PackageTags>claude-code;lsp;roslyn;csharp;dotnet;language-server</PackageTags>

src/ClaudeCodeRoslynLspProxy/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,12 @@ internal static async Task PumpAsync(Stream source, Stream sink, bool isClientTo
247247
}
248248
}
249249

250+
// `examined` stays at buffer.End: TryReadFrame walked the whole
251+
// residual to decide "not enough yet", so we've examined to End.
252+
// Setting examined < buffer.End would make ReadAsync return
253+
// synchronously with the same bytes and hot-spin until more data.
250254
consumed = buffer.Start;
251-
examined = buffer.Start;
255+
examined = buffer.End;
252256
}
253257

254258
if (result.IsCompleted)

0 commit comments

Comments
 (0)