Nice to have, not an immediate target.
Ship analyzers alongside the library the way EF Core, ASP.NET and the BCL do, so mistakes are caught at compile time in consumer code rather than at runtime against a live OBS.
Rules worth having
Positional construction of generated request records. This caused a real bug. SetSceneItemEnabledAsync passed sceneName positionally, and when the 5.7 protocol refresh inserted canvasUuid into the generated constructor the argument silently bound to the wrong parameter, so the scene was never sent and OBS answered with code 300. Parameter order follows the protocol definition and will shift again on the next refresh. An analyzer that requires named arguments for *RequestData constructors would have caught it at compile time, in every consumer's code as well as ours.
Typed batch references with parallel execution. BatchResults.Get refuses at runtime when a batch ran with RequestBatchExecutionType.Parallel, because OBS mislabels those results (#16). Where the execution type is a literal at the call site, that could be a squiggle instead.
Requests that are only valid inside a batch. Sleep outside a batch, or in a parallel batch, fails at runtime today.
Notes
Analyzers ship in analyzers/dotnet/cs inside the package. Each rule needs a DiagnosticId so consumers can suppress individually. Worth a code fix for the named-arguments rule, since that one is mechanical.
Nice to have, not an immediate target.
Ship analyzers alongside the library the way EF Core, ASP.NET and the BCL do, so mistakes are caught at compile time in consumer code rather than at runtime against a live OBS.
Rules worth having
Positional construction of generated request records. This caused a real bug.
SetSceneItemEnabledAsyncpassedsceneNamepositionally, and when the 5.7 protocol refresh insertedcanvasUuidinto the generated constructor the argument silently bound to the wrong parameter, so the scene was never sent and OBS answered with code 300. Parameter order follows the protocol definition and will shift again on the next refresh. An analyzer that requires named arguments for*RequestDataconstructors would have caught it at compile time, in every consumer's code as well as ours.Typed batch references with parallel execution.
BatchResults.Getrefuses at runtime when a batch ran withRequestBatchExecutionType.Parallel, because OBS mislabels those results (#16). Where the execution type is a literal at the call site, that could be a squiggle instead.Requests that are only valid inside a batch.
Sleepoutside a batch, or in a parallel batch, fails at runtime today.Notes
Analyzers ship in
analyzers/dotnet/csinside the package. Each rule needs aDiagnosticIdso consumers can suppress individually. Worth a code fix for the named-arguments rule, since that one is mechanical.