Skip to content

Add JsonRpc.DisplayName property#1395

Merged
AArnott merged 3 commits into
mainfrom
dev/andarno/addDisplayName
Feb 17, 2026
Merged

Add JsonRpc.DisplayName property#1395
AArnott merged 3 commits into
mainfrom
dev/andarno/addDisplayName

Conversation

@AArnott

@AArnott AArnott commented Feb 17, 2026

Copy link
Copy Markdown
Member

This has no functional value at runtime at all. But it will allow the brokered service library to 'name' each JsonRpc object it creates after the concrete type of the descriptor so that when serialization failures occur, it's much easier to backtrace the JsonRpc object to its owning descriptor so we know where to apply the fix.

Copilot AI review requested due to automatic review settings February 17, 2026 16:34
@AArnott AArnott added this to the v2.25 milestone Feb 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new DisplayName property to the JsonRpc class for improved debugging and diagnostics, allowing developers to assign human-readable names to JsonRpc instances to help trace them back to their creators. The property is purely for diagnostic purposes and doesn't affect RPC functionality.

Changes:

  • Adds a new public DisplayName property to JsonRpc class with init accessor for immutable configuration
  • Implements DebuggerDisplay attribute to show the display name in debugger views
  • Increments version from 2.24 to 2.25 to reflect the new API addition
  • Includes a style fix in NerdbankMessagePackFormatter.cs (removes unnecessary this. prefix in nameof)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
version.json Version bump from 2.24 to 2.25 for new API member
test/StreamJsonRpc.Tests/JsonRpcSimpleTests.cs New test file with tests for DisplayName property default and settable behaviors
src/StreamJsonRpc/JsonRpc.cs Adds DisplayName property, DebuggerDisplay attribute, and private DebuggerDisplay property
src/StreamJsonRpc/NerdbankMessagePackFormatter.cs Style fix: removes unnecessary this. prefix from MemberNotNull attribute

@AArnott
AArnott enabled auto-merge February 17, 2026 16:48
@AArnott
AArnott merged commit 989251e into main Feb 17, 2026
15 checks passed
@AArnott
AArnott deleted the dev/andarno/addDisplayName branch February 17, 2026 16:55
@crmann1

crmann1 commented Feb 17, 2026

Copy link
Copy Markdown
Member

Just what I needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants