Skip to content

Add C# scripting support for .csx scripts#4

Merged
MelbourneDeveloper merged 7 commits into
mainfrom
c#
Feb 27, 2026
Merged

Add C# scripting support for .csx scripts#4
MelbourneDeveloper merged 7 commits into
mainfrom
c#

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR;

  • Add C# scripting (.csx) support alongside existing F# scripting for pre/post request hooks in playlists
  • Full end-to-end implementation: core runner, VS Code extension, tests, examples, docs, and website updates

Details

  • Core (F#): Extended Runner.fs to execute .csx scripts via dotnet script, added Csx script type to Types.fs, updated Parser.fs to recognize .csx files
  • VS Code extension: Added .csx language configuration and file associations in package.json, added C# script constants, integrated .csx execution into the extension's playlist runner
  • OpenAPI Generator: New openApiGenerator.ts for generating API requests from OpenAPI specs
  • Tests: Added CsxScriptTests.fs (F# core tests) and csx-scripts.e2e.test.ts (VS Code e2e tests covering success, failure, compile errors, slow scripts, multi-output, and mixed F#/C# scenarios), plus playlist e2e tests
  • Examples: C# script examples (setup.csx, teardown.csx, report.csx, smoke-tests.csx, validate-env.csx), a crud-csharp.naplist playlist, and its HTML report
  • Docs/Website: New csharp-scripting.md doc page, updated all comparison pages, homepage, blog post, and README to reflect C# support

How do the tests prove the change works

  • CsxScriptTests.fs verifies core .csx script execution: successful runs capture stdout, failed scripts return error results, and compile errors are reported correctly
  • csx-scripts.e2e.test.ts runs full VS Code e2e tests against actual .csx scripts in playlists — validates output capture, error handling, compile error reporting, slow script behavior, multi-line output, and mixed F#/C# script playlists
  • playlist.e2e.test.ts tests playlist execution through the VS Code UI
  • CliIntegrationTests.fs extended with C# script integration tests for the CLI runner

The CSX tests require the dotnet-script global tool to execute
.csx files via `dotnet script`. Without it, all CSX tests fail
with "command or file was not found" on the CI runner.
@MelbourneDeveloper MelbourneDeveloper merged commit 4cdb6e6 into main Feb 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant