Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>ocamlformat-vscode-extensionNew to Visual Studio Code? Get it now.
ocamlformat-vscode-extension

ocamlformat-vscode-extension

hoddy3190

|
337 installs
| (0) | Free
vscode extension - simple wrapper of ocamlformat command
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ocamlformat-vscode-extension README

This extension wraps ocamlformat command.
I tested only on OSX, so I don't know it will work on other operating systems.

Features

It enables you to execute ocamlformat from Command Palette.

And also enables it on save and on paste if you add the following settings to settings.json

"editor.formatOnSave": true
"editor.formatOnPaste": true

Extension Settings

This extension has the following settings:

  • ocamlformat-vscode-extension.customOcamlformatPath
    • set path to ocamlformat command
    • if empty, ${OPAM_SWITCH_PREFIX}/bin/ocamlformat is used. In that case, you have to set path to opam command
  • ocamlformat-vscode-extension.ocamlformatOption
    • If multiple, use a comma as delimited string (e.g. ----enable-outside-detected-project,--ocp-indent-config)
    • I recommend that you only put options here that you can't put in .ocamlformat
    • Note:
      • This extension executes ocamlformat and replace file text with its "stdout". So it won't work if you set the following options
        • options to change the output destination
          • e.g. --inplace, -o etc.
        • options to output something other than formatted code
          • e.g. --help etc.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft