Skip to content
Unverified Commit e798104c authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Refactor `Instantiator` (#1863)

The `Instantiator` is a rather old part of the codebase that has been
accumulating a bit of technical debt.

This commit refactors `Instantiator.kt`.

* Removes dependency on `CodegenTarget`; the instantiator is now client
  and server agnostic. `ClientInstantiator` and `ServerInstantiator`
  instantiate the underlying instantiator with the settings needed by
  each project.
* The test suite has been completely rewritten to make use of the newer
  testing infrastructure (`TestWorkspace.testProject()`), and coverage
  around enum generation has been improved.
* `Instantiator.Ctx` and its uses have been simplified.
* The modified code has been reformatted to adhere to our styling
  conventions.

This commit also renames `StructureGenerator.fallibleBuilder` to
`StructureGenerator.hasFallibleBuilder`.

This commit also changes usages of `RustWriter::write` to
`RustWriter::rust` in `ServerProtocolTestGenerator`, where
applicable.

All in all this commit will make the diff of #1342 lighter, where
deviations among clients and servers regarding structure instantiation
substantially increase.
parent a5040e35
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment