diff --git a/docs/options.md b/docs/options.md index 960b0bc..1d96ef2 100644 --- a/docs/options.md +++ b/docs/options.md @@ -198,6 +198,40 @@ Options for ClangFormat executable. 2. Go into *Packages* and search for "*Atom Beautify*" package. 3. Find the option "*ClangFormat*" and change it to your desired configuration. +##### [Crystal](#crystal) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for Crystal executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*Crystal*" and change it to your desired configuration. + +##### [Dfmt](#dfmt) + +**Important**: This option is only configurable from within Atom Beautify's setting panel. + +**Type**: `object` + +**Description**: + +Options for Dfmt executable. + +**How to Configure** + +1. You can open the [Settings View](https://github.com/atom/settings-view) by navigating to +*Edit > Preferences (Linux)*, *Atom > Preferences (OS X)*, or *File > Preferences (Windows)*. +2. Go into *Packages* and search for "*Atom Beautify*" package. +3. Find the option "*Dfmt*" and change it to your desired configuration. + ##### [Emacs](#emacs) **Important**: This option is only configurable from within Atom Beautify's setting panel. diff --git a/src/beautifiers/dfmt.coffee b/src/beautifiers/dfmt.coffee index 0accd86..c114e1b 100644 --- a/src/beautifiers/dfmt.coffee +++ b/src/beautifiers/dfmt.coffee @@ -7,13 +7,20 @@ Beautifier = require('./beautifier') module.exports = class Dfmt extends Beautifier name: "dfmt" link: "https://github.com/Hackerpilot/dfmt" - isPreInstalled: false + executables: [ + { + name: "Dfmt" + cmd: "dfmt" + homepage: "https://github.com/Hackerpilot/dfmt" + installation: "https://github.com/dlang-community/dfmt#building" + } + ] options: { D: false } beautify: (text, language, options) -> - @run("dfmt", [ + @exe("dfmt").run([ @tempFile("input", text) ]) diff --git a/src/options.json b/src/options.json index 22061f8..74637a6 100644 --- a/src/options.json +++ b/src/options.json @@ -9194,6 +9194,38 @@ } } }, + "crystal": { + "key": "crystal", + "title": "Crystal", + "type": "object", + "collapsed": true, + "description": "Options for Crystal executable.", + "properties": { + "path": { + "key": "path", + "title": "Executable Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"crystal\" executable." + } + } + }, + "dfmt": { + "key": "dfmt", + "title": "Dfmt", + "type": "object", + "collapsed": true, + "description": "Options for Dfmt executable.", + "properties": { + "path": { + "key": "path", + "title": "Executable Path", + "type": "string", + "default": "", + "description": "Absolute path to the \"dfmt\" executable." + } + } + }, "emacs": { "key": "emacs", "title": "Emacs",