feat: rebuild RPC client and API generator - #42
Open
alsi-lawr wants to merge 3 commits into
Open
Conversation
alsi-lawr
force-pushed
the
feat/use-roslyn-generators
branch
2 times, most recently
from
July 22, 2026 18:36
df46a49 to
d3c200c
Compare
justinmk
reviewed
Jul 23, 2026
justinmk
reviewed
Jul 23, 2026
alsi-lawr
marked this pull request as draft
July 23, 2026 11:19
alsi-lawr
force-pushed
the
feat/use-roslyn-generators
branch
8 times, most recently
from
July 24, 2026 03:53
27fb366 to
795082d
Compare
alsi-lawr
marked this pull request as ready for review
July 24, 2026 04:01
alsi-lawr
force-pushed
the
feat/use-roslyn-generators
branch
from
July 24, 2026 10:05
795082d to
2bc6f1a
Compare
Contributor
Author
|
@justinmk I appreciate this is a big change. I've gone through the whole solution multiple times to get to this final minimal implementation that captures the requirements for a real durable RPC client. The diff looks a lot bigger than the actual code because a lot of it comes from the added documentation. |
test: await standard-I/O module readiness
alsi-lawr
force-pushed
the
feat/use-roslyn-generators
branch
from
July 24, 2026 10:30
2bc6f1a to
4a4b4b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This replaces the old split RPC client and generated API with one
Nvim.Clientpackage. It also:separate generated files.
This is intentionally one breaking change. The old generator emitted code
against the old runtime, so splitting this into several migrations would
require temporary compatibility code solely to connect the two designs.
Size and trade-offs
The branch remains larger than
upstream/master, but the final implementationis substantially smaller than the earlier version of this PR:
upstream/masterThese are SCC code lines. Generated output, build output, and the old tracked
NvimAPI.generated.csfile are excluded.Some runtime growth is necessary to fix #40 properly. A client which starts
Neovim or opens a connection has to know whether it owns the underlying
resource, stop it correctly, complete or fail pending requests, and expose when
the connection has ended. The old client mostly avoided this lifecycle state.
INvimClientis a separate trade-off. It lets application code accept, wrap,or substitute an existing client instead of depending directly on the sealed
NvimClientand its static connection factories. It retains the raw RPC APIand generated methods, and is the documentation source inherited by
NvimClient. There is no second implementation in this repository, so thisalso adds another public compatibility surface.
The test suite remains five integration tests. The metadata/emitter test now
checks the five generated output files, and the standard-I/O test waits for the
module's existing readiness signal before sending a request. No additional test
case was added.
Maintained production code by domain
SyntaxGeneratorfor ordinary AST construction, with direct C# syntax where it is clearer. It emits separate contract, client, handle, UI event, and UI factory files.StopAsync,Dispose, completion, connection failure, process shutdown, and TCP, Unix socket, named pipe, standard-I/O, and embedded Neovim support.NvimValuemodel, full MessagePack integer support, arbitrary map keys, immutable inputs, and low-level decoding usingUntrustedData.object-shaped API, in exchange for predictable wire behaviour.NvimClientfacade, specific RPC errors, and the documentedINvimClientabstraction.SCC does not count XML comments, so the documentation figure represents the
Doxygen parser and XML-documentation emitter rather than the generated
documentation itself.
The old generator combined metadata acquisition, documentation processing, and
C# generation in
NvimAPIGenerator.cs, so there is no useful upstream deltafor each generator subdomain. The branch can be split precisely because those
responsibilities are now separate.
The majority of the remaining increase is therefore deliberate:
Dropping
netstandard2.0removes the compatibility socket, buffer, process,and
IsExternalInitcode. This reduces the cost, but does not make the branchsmaller than master.
Breaking changes
Nvim.Client.net10.0only.NvimValuemodel.Verification
Release build passes with 0 warnings and 0 errors.
dotnet build Nvim.Client.slnx -c Release --no-restoreAll 5 integration tests pass.
dotnet test Nvim.Client.slnx -c Release --no-build --no-restoreCSharpier passes.
csharpier check src test Nvim.Client.slnx Directory.Build.props Directory.Packages.propsRegenerating from Neovim 0.12.4 produces no tracked changes.
dotnet run --project src/Nvim.Client.Generator.Cli /path/to/neovimgit diff --exit-codeThe only skipped methods are the two unsupported
LuaRefAPIs:nvim_buf_callandnvim_win_call.The release package builds successfully with one
net10.0DLL/XML pair andno Workspaces dependency.
dotnet pack src/Nvim.Client/Nvim.Client.csproj -c Release --no-build --no-restoreFollow-up
#36 will have the major CI changes (with the version change to match neovim versioning + the hard requirement for a nuget api key in project secrets).
Closes #31
Closes #35
Closes #40