added erlang support
This commit is contained in:
parent
ca5529a2dc
commit
ec5071a70d
|
@ -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] [Erlang]()
|
||||
- Requires erlang syntax_tools to be installed
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
###
|
||||
Requires https://github.com/hhatto/autopep8
|
||||
###
|
||||
|
||||
"use strict"
|
||||
Beautifier = require('./beautifier')
|
||||
|
||||
module.exports = class ErlTidy extends Beautifier
|
||||
|
||||
name: "erl_tidy"
|
||||
|
||||
options: {
|
||||
Erlang: true
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
tempFile = undefined
|
||||
@tempFile("input", text).then((path) =>
|
||||
tempFile = path
|
||||
@run("erl", [
|
||||
["-eval", 'erl_tidy:file("' + tempFile + '")']
|
||||
["-noshell", "-s", "init", "stop"]
|
||||
])
|
||||
).then(=>
|
||||
@readFile(tempFile)
|
||||
)
|
|
@ -57,6 +57,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
'tidy-markdown'
|
||||
'typescript-formatter'
|
||||
'yapf'
|
||||
'erl_tidy'
|
||||
]
|
||||
|
||||
###
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
module.exports = {
|
||||
|
||||
name: "Erlang"
|
||||
namespace: "erlang"
|
||||
fallback: []
|
||||
|
||||
###
|
||||
Supported Grammars
|
||||
###
|
||||
grammars: [
|
||||
"Erlang"
|
||||
]
|
||||
|
||||
###
|
||||
Supported extensions
|
||||
###
|
||||
extensions: ['erl']
|
||||
|
||||
options: []
|
||||
|
||||
}
|
|
@ -22,6 +22,7 @@ module.exports = class Languages
|
|||
"d"
|
||||
"ejs"
|
||||
"erb"
|
||||
"erlang"
|
||||
"gherkin"
|
||||
"go"
|
||||
"fortran"
|
||||
|
|
Loading…
Reference in New Issue