opencode
opencode copied to clipboard
feat(format): add fantomas formatter for F# files
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:
- Checks if
dotnetCLI is available - Runs
dotnet tool list --globalto check for global installation - Falls back to
dotnet tool listto check for local tool manifest - 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)
The following comment was made by an LLM, it may be inaccurate:
No duplicate PRs found