opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(format): add fantomas formatter for F# files

Open ThanhNguyxn opened this issue 1 week ago • 1 comments

Summary

Adds support for the fantomas F# code formatter as requested in the discussion of #5535.

Changes

Added fantomas formatter to packages/opencode/src/format/formatter.ts:

  • Command: dotnet fantomas $FILE
  • Extensions: .fs, .fsx, .fsi
  • Availability check: Verifies both global and local dotnet tool installations

How it works

The formatter:

  1. Checks if dotnet CLI is available
  2. Runs dotnet tool list --global to check for global installation
  3. Falls back to dotnet tool list to check for local tool manifest
  4. Only enables if fantomas is found in either location

Installation for users

To use this formatter, users need to install fantomas:

# Global installation
dotnet tool install fantomas -g

# Or local installation (in project directory)
dotnet tool install fantomas

Related Issues

  • #5535 - F# LSP feature request (comments mention formatter support)

ThanhNguyxn avatar Jan 07 '26 05:01 ThanhNguyxn

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 07 '26 05:01 github-actions[bot]