Switch Uncrustify to using Exectuables
This commit is contained in:
parent
cefa7afa6b
commit
9144df29a1
|
@ -242,6 +242,27 @@ Options for PHPCBF executable.
|
|||
2. Go into *Packages* and search for "*Atom Beautify*" package.
|
||||
3. Find the option "*PHPCBF*" and change it to your desired configuration.
|
||||
|
||||
##### [Uncrustify](#uncrustify)
|
||||
|
||||
**Namespace**: ``
|
||||
|
||||
**Key**: `uncrustify`
|
||||
|
||||
**Type**: `object`
|
||||
|
||||
**Supported Beautifiers**: [`Uncrustify`](#uncrustify)
|
||||
|
||||
**Description**:
|
||||
|
||||
Options for Uncrustify 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 "*Uncrustify*" and change it to your desired configuration.
|
||||
|
||||
#### [Apex](#apex)
|
||||
|
||||
**Supported Beautifiers**: [`Uncrustify`](#uncrustify)
|
||||
|
@ -19072,6 +19093,27 @@ Path to uncrustify config file. i.e. uncrustify.cfg (Supported by Uncrustify)
|
|||
}
|
||||
```
|
||||
|
||||
##### [Uncrustify](#uncrustify)
|
||||
|
||||
**Namespace**: ``
|
||||
|
||||
**Key**: `uncrustify`
|
||||
|
||||
**Type**: `object`
|
||||
|
||||
**Supported Beautifiers**: [`Uncrustify`](#uncrustify)
|
||||
|
||||
**Description**:
|
||||
|
||||
Options for Uncrustify 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 "*Uncrustify*" and change it to your desired configuration.
|
||||
|
||||
|
||||
### Vue Beautifier
|
||||
|
||||
|
|
|
@ -11,7 +11,17 @@ _ = require('lodash')
|
|||
module.exports = class Uncrustify extends Beautifier
|
||||
name: "Uncrustify"
|
||||
link: "https://github.com/uncrustify/uncrustify"
|
||||
isPreInstalled: false
|
||||
executables: [
|
||||
{
|
||||
name: "Uncrustify"
|
||||
cmd: "uncrustify"
|
||||
homepage: "http://uncrustify.sourceforge.net/"
|
||||
installation: "https://github.com/uncrustify/uncrustify"
|
||||
version: {
|
||||
parse: (text) -> text.match(/uncrustify (\d+\.\d+)/)[1] + ".0"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
options: {
|
||||
Apex: true
|
||||
|
@ -27,6 +37,7 @@ module.exports = class Uncrustify extends Beautifier
|
|||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
uncrustify = @exe("uncrustify")
|
||||
# console.log('uncrustify.beautify', language, options)
|
||||
return new @Promise((resolve, reject) ->
|
||||
configPath = options.configPath
|
||||
|
@ -50,8 +61,6 @@ module.exports = class Uncrustify extends Beautifier
|
|||
reject(new Error("No Uncrustify Config Path set! Please configure Uncrustify with Atom Beautify."))
|
||||
)
|
||||
.then((configPath) =>
|
||||
|
||||
|
||||
# Select Uncrustify language
|
||||
lang = "C" # Default is C
|
||||
switch language
|
||||
|
@ -76,7 +85,7 @@ module.exports = class Uncrustify extends Beautifier
|
|||
when "Arduino"
|
||||
lang = "CPP"
|
||||
|
||||
@run("uncrustify", [
|
||||
uncrustify.run([
|
||||
"-c"
|
||||
configPath
|
||||
"-f"
|
||||
|
|
|
@ -9130,6 +9130,25 @@
|
|||
"order": -1,
|
||||
"description": "Configure executables used by beautifiers.",
|
||||
"properties": {
|
||||
"uncrustify": {
|
||||
"key": "uncrustify",
|
||||
"title": "Uncrustify",
|
||||
"type": "object",
|
||||
"collapsed": true,
|
||||
"description": "Options for Uncrustify executable.",
|
||||
"beautifiers": [
|
||||
"Uncrustify"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"key": "path",
|
||||
"title": "Executable Path",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Absolute path to the \"uncrustify\" executable."
|
||||
}
|
||||
}
|
||||
},
|
||||
"emacs": {
|
||||
"key": "emacs",
|
||||
"title": "Emacs",
|
||||
|
|
Loading…
Reference in New Issue