diff --git a/README.md b/README.md index eb75274..5f56f17 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify` - [x] [Vala](https://github.com/Glavin001/atom-beautify/issues/57) - Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/) - [x] [TypeScript](https://github.com/Glavin001/atom-beautify/issues/49) +- [x] [Haskell](https://github.com/Glavin001/atom-beautify/issues/628) + - Requires [stylish-haskell](https://github.com/jaspervdj/stylish-haskell) ## Usage diff --git a/src/beautifiers/index.coffee b/src/beautifiers/index.coffee index 2641fd3..a0985fc 100644 --- a/src/beautifiers/index.coffee +++ b/src/beautifiers/index.coffee @@ -53,6 +53,7 @@ module.exports = class Beautifiers extends EventEmitter 'ruby-beautify' 'rustfmt' 'sqlformat' + 'stylish-haskell' 'tidy-markdown' 'typescript-formatter' 'yapf' @@ -121,7 +122,7 @@ module.exports = class Beautifiers extends EventEmitter # Remember Option's Key op.key = field - + # Remember Option's Language op.language = lang diff --git a/src/beautifiers/stylish-haskell.coffee b/src/beautifiers/stylish-haskell.coffee new file mode 100644 index 0000000..0e6f055d --- /dev/null +++ b/src/beautifiers/stylish-haskell.coffee @@ -0,0 +1,18 @@ +### +Requires https://github.com/jaspervdj/stylish-haskell +### + +"use strict" +Beautifier = require('./beautifier') + +module.exports = class StylishHaskell extends Beautifier + name: "stylish-haskell" + + options: { + Haskell: true + } + + beautify: (text, language, options) -> + @run("stylish-haskell", [ + @tempFile("input", text) + ]) diff --git a/src/languages/haskell.coffee b/src/languages/haskell.coffee new file mode 100644 index 0000000..31ec842 --- /dev/null +++ b/src/languages/haskell.coffee @@ -0,0 +1,22 @@ +module.exports = { + + name: "Haskell" + namespace: "haskell" + + ### + Supported Grammars + ### + grammars: [ + "Haskell" + ] + + ### + Supported extensions + ### + extensions: [ + "hs" + ] + + options: [] + +} diff --git a/src/languages/index.coffee b/src/languages/index.coffee index 177e9b6..5cbd709 100644 --- a/src/languages/index.coffee +++ b/src/languages/index.coffee @@ -26,6 +26,7 @@ module.exports = class Languages "go" "fortran" "handlebars" + "haskell" "html" "java" "javascript"