Add support for Elm

This commit is contained in:
Murphy Randle 2015-12-10 06:42:08 -07:00
parent bb91eab955
commit 31695b33c9
9 changed files with 68 additions and 0 deletions

View File

@ -59,3 +59,6 @@ before_install:
- brew install haskell-stack
- stack setup
- stack install stylish-haskell
# Elm
- curl -L -o /tmp/elm-format.tgz
- tar xvzf -C /usr/local/bin /tmp/elm-format.tgz

View File

@ -70,6 +70,8 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify`
- [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)
- [x] [Elm]()
- Requires [Elm-Format](https://github.com/avh4/elm-format)
## Usage

View File

@ -0,0 +1,9 @@
module Main (..) where
addThings x y =
x + y
main =
addThings 4 5

View File

@ -0,0 +1,3 @@
addThings x y = x + y
main = addThings 4 5

View File

@ -0,0 +1,18 @@
###
Requires https://github.com/avh4/elm-format
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class ElmFormat extends Beautifier
name: "elm-format"
options: {
Elm: true
}
beautify: (text, language, options) ->
@run("elm-format", [
@tempFile("input", text)
])

View File

@ -38,6 +38,7 @@ module.exports = class Beautifiers extends EventEmitter
'coffee-formatter'
'coffee-fmt'
'clang-format'
'elm-format'
'htmlbeautifier'
'csscomb'
'gherkin'

22
src/languages/elm.coffee Normal file
View File

@ -0,0 +1,22 @@
module.exports = {
name: "Elm"
namespace: "elm"
###
Supported Grammars
###
grammars: [
"Elm"
]
###
Supported extensions
###
extensions: [
"elm"
]
options: []
}

View File

@ -21,6 +21,7 @@ module.exports = class Languages
"csv"
"d"
"ejs"
"elm"
"erb"
"gherkin"
"go"

9
test.elm Normal file
View File

@ -0,0 +1,9 @@
module Main (..) where
addThings x y =
Signal.map (x + y)
main =
addThings 4 5