codegen: --language fsharp flag (2.4.1)#406
Merged
Merged
Conversation
Adds a `--language` flag (csharp|fsharp, default csharp) to the `codegen` command so `dotnet run -- codegen write --language fsharp` writes the pre-generated code as F# (.fs) instead of C# (.cs). The F# emit capability (GeneratedAssembly.GenerateFSharpCode) already existed; this wires it through the CLI. - CodegenLanguage enum + GenerateCodeInput.LanguageFlag. - DynamicCodeBuilder.Language threads into the write and preview paths (renderCode picks GenerateFSharpCode vs GenerateCode; .fs vs .cs extension). - `codegen test --language fsharp` is rejected with a clear message (the test action uses in-memory C# Roslyn compilation, which doesn't apply to F#). - CI: SmokeTestCommands runs `codegen preview --language fsharp --start` against GeneratorTarget to validate the CLI flag emits F#. (Compilable/runnable pre-generated F# is proven downstream against real Wolverine handler chains.) - 5 unit tests for the language switch + .fs extension. Bumped JasperFxVersion to 2.4.1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 1, 2026
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.
Adds a
--languageflag (csharp|fsharp, defaultcsharp) to thecodegencommand so a JasperFx app can pre-generate its runtime code as F#:The F# emit capability (
GeneratedAssembly.GenerateFSharpCode) already existed; this wires it through the CLI write/preview paths.Changes
CodegenLanguageenum +GenerateCodeInput.LanguageFlag.DynamicCodeBuilder.Languagethreads into both the write and preview paths —renderCodepicksGenerateFSharpCodevsGenerateCode, and the file extension is.fsvs.cs.codegen test --language fsharpis rejected with a clear message (thetestaction uses in-memory C# Roslyn compilation, which doesn't apply to F#).SmokeTestCommandsnow also runscodegen preview --language fsharp --startagainstGeneratorTarget, validating the flag emits F# end-to-end through the CLI..fsextension.JasperFxVersion→ 2.4.1.Verification
dotnet build jasperfx.slnx -c Releaseclean; 404 CodegenTests pass.codegen preview --language fsharpagainstGeneratorTargeton net9.0 and net10.0 — emitsnamespace/open/typeF#.Scope note
This proves the CLI plumbing. Compilable/runnable pre-generated F# is proven downstream against real Wolverine handler chains (the F# emitter targets the static model and is validated by Wolverine's behavioural run-step under
TypeLoadMode.Static). The experimental emitter's handling of some C#-style frames (e.g.return) is unchanged here.🤖 Generated with Claude Code