Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9024f2b2f7
31
README.md
31
README.md
|
@ -86,35 +86,6 @@ For example:
|
||||||
'ctrl-alt-b': 'atom-beautify:beautify-editor'
|
'ctrl-alt-b': 'atom-beautify:beautify-editor'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Package Options
|
|
||||||
|
|
||||||
Each language and its beautifier's options are fully documented in the Atom
|
|
||||||
Beautify package settings panel. There are far too many to document them all
|
|
||||||
here. Here are a few key options that you may use:
|
|
||||||
|
|
||||||
- `beautifyOnSave` (Default *false*)
|
|
||||||
You can also choose to beautify on every file save.
|
|
||||||
|
|
||||||
- `beautifyEntireFileOnSave` (Default *true*)
|
|
||||||
Beautification will normally only beautify your selected text.
|
|
||||||
However, when beautification occurs on save then it will
|
|
||||||
be forced to beautify the entire file's contents,
|
|
||||||
not just selected text.
|
|
||||||
|
|
||||||
- `muteUnsupportedLanguageErrors` (Default *false*)
|
|
||||||
Mute only *unsupported language* errors.
|
|
||||||
|
|
||||||
- `muteAllErrors` (Default *false*)
|
|
||||||
Do not show the *Atom Beautify Error Messages* panel
|
|
||||||
for any of the errors occurring while beautifying.
|
|
||||||
|
|
||||||
- `analytics` (Default *true*)
|
|
||||||
There is [Segment.io](https://segment.io/) which forwards data to [Google
|
|
||||||
Analytics](http://www.google.com/analytics/) to track what languages are being
|
|
||||||
used the most, as well as other stats. Everything is anonymized and no personal
|
|
||||||
information, such as source code, is sent.
|
|
||||||
See https://github.com/Glavin001/atom-beautify/issues/47 for more details.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Edit your `.jsbeautifyrc` file in any of the following locations:
|
Edit your `.jsbeautifyrc` file in any of the following locations:
|
||||||
|
@ -130,7 +101,7 @@ Edit your `.jsbeautifyrc` file in any of the following locations:
|
||||||
|
|
||||||
See examples of both ways inside [`examples/`](https://github.com/donaldpipowitch/atom-beautify/tree/master/examples)
|
See examples of both ways inside [`examples/`](https://github.com/donaldpipowitch/atom-beautify/tree/master/examples)
|
||||||
|
|
||||||
An option table is available at the [js-beautify repo](https://github.com/beautify-web/js-beautify#options).
|
See [all supported options in the documentation at `docs/options.md`](https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md).
|
||||||
|
|
||||||
### Simple
|
### Simple
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Atom Beautify Documentation
|
||||||
|
|
||||||
|
See [options.md](options.md) for supported beautification options.
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env coffee
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
Handlebars = require('handlebars')
|
||||||
|
Beautifiers = require("../src/beautifiers")
|
||||||
|
fs = require('fs')
|
||||||
|
|
||||||
|
console.log('Generating options...')
|
||||||
|
beautifier = new Beautifiers()
|
||||||
|
languageOptions = beautifier.options
|
||||||
|
packageOptions = require('../src/config.coffee')
|
||||||
|
|
||||||
|
console.log('Loading options template...')
|
||||||
|
optionsTemplatePath = __dirname + '/options-template.md'
|
||||||
|
optionTemplatePath = __dirname + '/option-template.md'
|
||||||
|
optionsPath = __dirname + '/options.md'
|
||||||
|
optionsTemplate = fs.readFileSync(optionsTemplatePath).toString()
|
||||||
|
optionTemplate = fs.readFileSync(optionTemplatePath).toString()
|
||||||
|
|
||||||
|
console.log('Building documentation from template and options...')
|
||||||
|
Handlebars.registerPartial('option', optionTemplate)
|
||||||
|
template = Handlebars.compile(optionsTemplate)
|
||||||
|
context = {
|
||||||
|
packageOptions: packageOptions
|
||||||
|
languageOptions: languageOptions
|
||||||
|
}
|
||||||
|
result = template(context)
|
||||||
|
|
||||||
|
console.log('Writing documentation to file...')
|
||||||
|
fs.writeFileSync(optionsPath, result)
|
||||||
|
|
||||||
|
console.log('Done.')
|
|
@ -0,0 +1,17 @@
|
||||||
|
### {{#if title}} {{title}} {{else}} `{{@key}}` {{/if}}
|
||||||
|
|
||||||
|
**Key**: `{{@key}}`
|
||||||
|
{{#if default}}
|
||||||
|
|
||||||
|
**Default**: `{{default}}`
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
**Type**: `{{type}}`
|
||||||
|
{{#if enum}}
|
||||||
|
|
||||||
|
**Enum**: {{#each enum}} `{{this}}` {{/each}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
**Description**:
|
||||||
|
|
||||||
|
{{description}}
|
|
@ -0,0 +1,23 @@
|
||||||
|
# Options
|
||||||
|
|
||||||
|
Automatically generated documentation for Atom Beautify's options.
|
||||||
|
|
||||||
|
## Package Options
|
||||||
|
|
||||||
|
Configurable options for Atom Beautify.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{{#each packageOptions}}
|
||||||
|
{{> option}}
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
## Language Options
|
||||||
|
|
||||||
|
Supported options for each language.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
{{#each languageOptions}}
|
||||||
|
{{> option}}
|
||||||
|
{{/each}}
|
File diff suppressed because it is too large
Load Diff
300
package.json
300
package.json
|
@ -1,143 +1,173 @@
|
||||||
{
|
{
|
||||||
"name": "atom-beautify",
|
"name": "atom-beautify",
|
||||||
"main": "./src/beautify",
|
"main": "./src/beautify",
|
||||||
"version": "0.27.9",
|
"version": "0.27.9",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, and SQL in Atom",
|
"description": "Beautify HTML, CSS, JavaScript, PHP, Python, Ruby, Java, C, C++, C#, Objective-C, CoffeeScript, TypeScript, and SQL in Atom",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Glavin001/atom-beautify"
|
"url": "https://github.com/Glavin001/atom-beautify"
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/Glavin001/atom-beautify/issues"
|
|
||||||
},
|
|
||||||
"license": "MIT",
|
|
||||||
"author": {
|
|
||||||
"name": "Glavin Wiechert",
|
|
||||||
"email": "glavin.wiechert@gmail.com",
|
|
||||||
"url": "https://github.com/Glavin001"
|
|
||||||
},
|
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "Donald Pipowitch",
|
|
||||||
"email": "pipo@senaeh.de",
|
|
||||||
"url": "https://github.com/donaldpipowitch"
|
|
||||||
},
|
},
|
||||||
{
|
"bugs": {
|
||||||
"name": "László Károlyi",
|
"url": "https://github.com/Glavin001/atom-beautify/issues"
|
||||||
"url": "https://github.com/karolyi"
|
|
||||||
},
|
},
|
||||||
{
|
"license": "MIT",
|
||||||
"name": "Marco Tanzi",
|
"author": {
|
||||||
"url": "https://github.com/mtanzi"
|
"name": "Glavin Wiechert",
|
||||||
|
"email": "glavin.wiechert@gmail.com",
|
||||||
|
"url": "https://github.com/Glavin001"
|
||||||
},
|
},
|
||||||
{
|
"contributors": [{
|
||||||
"name": "gvn lazar suntop",
|
"name": "Donald Pipowitch",
|
||||||
"url": "https://github.com/gvn"
|
"email": "pipo@senaeh.de",
|
||||||
|
"url": "https://github.com/donaldpipowitch"
|
||||||
|
}, {
|
||||||
|
"name": "László Károlyi",
|
||||||
|
"url": "https://github.com/karolyi"
|
||||||
|
}, {
|
||||||
|
"name": "Marco Tanzi",
|
||||||
|
"url": "https://github.com/mtanzi"
|
||||||
|
}, {
|
||||||
|
"name": "gvn lazar suntop",
|
||||||
|
"url": "https://github.com/gvn"
|
||||||
|
}, {
|
||||||
|
"name": "Vadim K.",
|
||||||
|
"url": "https://github.com/vadirn"
|
||||||
|
}, {
|
||||||
|
"name": "Filipe Silva",
|
||||||
|
"url": "https://github.com/filipesilva"
|
||||||
|
}, {
|
||||||
|
"name": "Ramón Cahenzli",
|
||||||
|
"url": "https://github.com/psy-q"
|
||||||
|
}],
|
||||||
|
"engines": {
|
||||||
|
"atom": ">=0.174.0 <2.0.0"
|
||||||
},
|
},
|
||||||
{
|
"dependencies": {
|
||||||
"name": "Vadim K.",
|
"analytics-node": "^1.2.2",
|
||||||
"url": "https://github.com/vadirn"
|
"async": "^1.0.0",
|
||||||
|
"atom-message-panel": "^1.2.4",
|
||||||
|
"atom-space-pen-views": "^2.0.5",
|
||||||
|
"bluebird": "^2.9.26",
|
||||||
|
"coffee-fmt": "0.10.2",
|
||||||
|
"coffee-formatter": "^0.1.2",
|
||||||
|
"csscomb": "^3.1.5",
|
||||||
|
"diff": "^1.4.0",
|
||||||
|
"editorconfig": "^0.12.2",
|
||||||
|
"emissary": "^1.3.3",
|
||||||
|
"event-kit": "^1.2.0",
|
||||||
|
"expand-home-dir": "0.0.2",
|
||||||
|
"extend": "^2.0.1",
|
||||||
|
"js-beautify": "^1.5.6",
|
||||||
|
"lodash": "3.9.3",
|
||||||
|
"loophole": "^1.0.0",
|
||||||
|
"node-dir": "^0.1.8",
|
||||||
|
"node-uuid": "^1.4.3",
|
||||||
|
"prettydiff": "^1.11.21",
|
||||||
|
"space-pen": "^5.1.1",
|
||||||
|
"strip-json-comments": "^1.0.2",
|
||||||
|
"temp": "^0.8.1",
|
||||||
|
"tidy-markdown": "^0.3.2",
|
||||||
|
"typescript-formatter": "~0.3.2",
|
||||||
|
"underscore-plus": "^1.6.6",
|
||||||
|
"winston": "^1.0.0",
|
||||||
|
"yaml-front-matter": "^3.2.3"
|
||||||
},
|
},
|
||||||
{
|
"activationCommands": {
|
||||||
"name": "Filipe Silva",
|
"atom-workspace": [
|
||||||
"url": "https://github.com/filipesilva"
|
"atom-beautify:help-debug-editor",
|
||||||
|
"atom-beautify:beautify-editor",
|
||||||
|
"core:save",
|
||||||
|
"core:save-as"
|
||||||
|
],
|
||||||
|
".tree-view .file .name": [
|
||||||
|
"atom-beautify:beautify-file"
|
||||||
|
],
|
||||||
|
".tree-view .directory .name": [
|
||||||
|
"atom-beautify:beautify-directory"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
"keywords": [
|
||||||
"name": "Ramón Cahenzli",
|
"atom",
|
||||||
"url": "https://github.com/psy-q"
|
"beautify",
|
||||||
|
"beautifier",
|
||||||
|
"js-beautify",
|
||||||
|
"format",
|
||||||
|
"pretty",
|
||||||
|
"html",
|
||||||
|
"handlebars",
|
||||||
|
"mustache",
|
||||||
|
"xml",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"css",
|
||||||
|
"sass",
|
||||||
|
"scss",
|
||||||
|
"less",
|
||||||
|
"sql",
|
||||||
|
"markdown",
|
||||||
|
"php",
|
||||||
|
"python",
|
||||||
|
"ruby",
|
||||||
|
"coffeescript",
|
||||||
|
"typescript",
|
||||||
|
"c",
|
||||||
|
"c++",
|
||||||
|
"cpp",
|
||||||
|
"objective-c",
|
||||||
|
"c-sharp",
|
||||||
|
"c#",
|
||||||
|
"uncrustify",
|
||||||
|
"java",
|
||||||
|
"pawn",
|
||||||
|
"vala",
|
||||||
|
"d",
|
||||||
|
"erb",
|
||||||
|
"editorconfig",
|
||||||
|
"yaml",
|
||||||
|
"front matter",
|
||||||
|
"jekyll",
|
||||||
|
"marko",
|
||||||
|
"go",
|
||||||
|
"golang"
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"analytics-node": "^1.2.2",
|
||||||
|
"async": "^1.0.0",
|
||||||
|
"atom-message-panel": "^1.2.4",
|
||||||
|
"atom-space-pen-views": "^2.0.5",
|
||||||
|
"bluebird": "^2.9.26",
|
||||||
|
"coffee-fmt": "0.10.2",
|
||||||
|
"coffee-formatter": "^0.1.2",
|
||||||
|
"csscomb": "^3.1.5",
|
||||||
|
"diff": "^1.4.0",
|
||||||
|
"editorconfig": "^0.12.2",
|
||||||
|
"emissary": "^1.3.3",
|
||||||
|
"event-kit": "^1.2.0",
|
||||||
|
"expand-home-dir": "0.0.2",
|
||||||
|
"extend": "^2.0.1",
|
||||||
|
"js-beautify": "^1.5.6",
|
||||||
|
"lodash": "3.9.3",
|
||||||
|
"loophole": "^1.0.0",
|
||||||
|
"node-dir": "^0.1.8",
|
||||||
|
"node-uuid": "^1.4.3",
|
||||||
|
"prettydiff": "^1.11.21",
|
||||||
|
"space-pen": "^5.1.1",
|
||||||
|
"strip-json-comments": "^1.0.2",
|
||||||
|
"temp": "^0.8.1",
|
||||||
|
"tidy-markdown": "^0.3.2",
|
||||||
|
"typescript-formatter": "~0.3.2",
|
||||||
|
"underscore-plus": "^1.6.6",
|
||||||
|
"winston": "^1.0.0",
|
||||||
|
"yaml-front-matter": "^3.2.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"coffee-script": "^1.9.3",
|
||||||
|
"handlebars": "^3.0.3"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"prepublish": "npm run docs",
|
||||||
|
"docs": "coffee docs/"
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"engines": {
|
|
||||||
"atom": ">=0.174.0 <2.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"analytics-node": "^1.2.2",
|
|
||||||
"async": "^1.0.0",
|
|
||||||
"atom-message-panel": "^1.2.4",
|
|
||||||
"atom-space-pen-views": "^2.0.5",
|
|
||||||
"bluebird": "^2.9.26",
|
|
||||||
"coffee-fmt": "0.10.2",
|
|
||||||
"coffee-formatter": "^0.1.2",
|
|
||||||
"csscomb": "^3.1.5",
|
|
||||||
"diff": "^1.4.0",
|
|
||||||
"editorconfig": "^0.12.2",
|
|
||||||
"emissary": "^1.3.3",
|
|
||||||
"event-kit": "^1.2.0",
|
|
||||||
"expand-home-dir": "0.0.2",
|
|
||||||
"extend": "^2.0.1",
|
|
||||||
"js-beautify": "^1.5.6",
|
|
||||||
"lodash": "3.9.3",
|
|
||||||
"loophole": "^1.0.0",
|
|
||||||
"node-dir": "^0.1.8",
|
|
||||||
"node-uuid": "^1.4.3",
|
|
||||||
"prettydiff": "^1.11.21",
|
|
||||||
"space-pen": "^5.1.1",
|
|
||||||
"strip-json-comments": "^1.0.2",
|
|
||||||
"temp": "^0.8.1",
|
|
||||||
"tidy-markdown": "^0.3.2",
|
|
||||||
"typescript-formatter": "~0.3.2",
|
|
||||||
"underscore-plus": "^1.6.6",
|
|
||||||
"winston": "^1.0.0",
|
|
||||||
"yaml-front-matter": "^3.2.3"
|
|
||||||
},
|
|
||||||
"activationCommands": {
|
|
||||||
"atom-workspace": [
|
|
||||||
"atom-beautify:help-debug-editor",
|
|
||||||
"atom-beautify:beautify-editor",
|
|
||||||
"core:save",
|
|
||||||
"core:save-as"
|
|
||||||
],
|
|
||||||
".tree-view .file .name": [
|
|
||||||
"atom-beautify:beautify-file"
|
|
||||||
],
|
|
||||||
".tree-view .directory .name": [
|
|
||||||
"atom-beautify:beautify-directory"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"atom",
|
|
||||||
"beautify",
|
|
||||||
"beautifier",
|
|
||||||
"js-beautify",
|
|
||||||
"format",
|
|
||||||
"pretty",
|
|
||||||
"html",
|
|
||||||
"handlebars",
|
|
||||||
"mustache",
|
|
||||||
"xml",
|
|
||||||
"css",
|
|
||||||
"javascript",
|
|
||||||
"json",
|
|
||||||
"css",
|
|
||||||
"sass",
|
|
||||||
"scss",
|
|
||||||
"less",
|
|
||||||
"sql",
|
|
||||||
"markdown",
|
|
||||||
"php",
|
|
||||||
"python",
|
|
||||||
"ruby",
|
|
||||||
"coffeescript",
|
|
||||||
"typescript",
|
|
||||||
"c",
|
|
||||||
"c++",
|
|
||||||
"cpp",
|
|
||||||
"objective-c",
|
|
||||||
"c-sharp",
|
|
||||||
"c#",
|
|
||||||
"uncrustify",
|
|
||||||
"java",
|
|
||||||
"pawn",
|
|
||||||
"vala",
|
|
||||||
"d",
|
|
||||||
"erb",
|
|
||||||
"editorconfig",
|
|
||||||
"yaml",
|
|
||||||
"front matter",
|
|
||||||
"jekyll",
|
|
||||||
"marko",
|
|
||||||
"go",
|
|
||||||
"golang"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -426,38 +426,7 @@ handleSaveEvent = =>
|
||||||
plugin.subscribe disposable
|
plugin.subscribe disposable
|
||||||
{Subscriber} = require path.join(atom.packages.resourcePath, 'node_modules', 'emissary')
|
{Subscriber} = require path.join(atom.packages.resourcePath, 'node_modules', 'emissary')
|
||||||
Subscriber.extend plugin
|
Subscriber.extend plugin
|
||||||
plugin.config = _.merge(
|
plugin.config = _.merge(require('./config.coffee'), defaultLanguageOptions)
|
||||||
analytics :
|
|
||||||
type : 'boolean'
|
|
||||||
default : true
|
|
||||||
description : "Automatically send usage information (NEVER CODE) to Google Analytics"
|
|
||||||
_analyticsUserId :
|
|
||||||
type : 'string'
|
|
||||||
default : ""
|
|
||||||
description : "Unique identifier for this user for tracking usage analytics"
|
|
||||||
_loggerLevel :
|
|
||||||
type : 'string'
|
|
||||||
default : 'warn'
|
|
||||||
description : 'Set the level for the logger'
|
|
||||||
enum : ['verbose', 'debug', 'info', 'warn', 'error']
|
|
||||||
beautifyOnSave :
|
|
||||||
title : "DEPRECATED: Beautfy On Save"
|
|
||||||
type : 'boolean'
|
|
||||||
default : false
|
|
||||||
description : "Beautify active editor on save"
|
|
||||||
beautifyEntireFileOnSave :
|
|
||||||
type : 'boolean'
|
|
||||||
default : true
|
|
||||||
description : "When beautifying on save, use the entire file, even if there is selected text in the editor"
|
|
||||||
muteUnsupportedLanguageErrors :
|
|
||||||
type : 'boolean'
|
|
||||||
default : false
|
|
||||||
description : "Do not show \"Unsupported Language\" errors when they occur"
|
|
||||||
muteAllErrors :
|
|
||||||
type : 'boolean'
|
|
||||||
default : false
|
|
||||||
description : "Do not show any/all errors when they occur"
|
|
||||||
, defaultLanguageOptions)
|
|
||||||
plugin.activate = ->
|
plugin.activate = ->
|
||||||
handleSaveEvent()
|
handleSaveEvent()
|
||||||
plugin.subscribe atom.config.observe("atom-beautify.beautifyOnSave", handleSaveEvent)
|
plugin.subscribe atom.config.observe("atom-beautify.beautifyOnSave", handleSaveEvent)
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
module.exports = {
|
||||||
|
analytics :
|
||||||
|
type : 'boolean'
|
||||||
|
default : true
|
||||||
|
description : "There is [Segment.io](https://segment.io/) which forwards data to [Google
|
||||||
|
Analytics](http://www.google.com/analytics/) to track what languages are being
|
||||||
|
used the most, as well as other stats. Everything is anonymized and no personal
|
||||||
|
information, such as source code, is sent.
|
||||||
|
See https://github.com/Glavin001/atom-beautify/issues/47 for more details."
|
||||||
|
_analyticsUserId :
|
||||||
|
type : 'string'
|
||||||
|
default : ""
|
||||||
|
description : "Unique identifier for this user for tracking usage analytics"
|
||||||
|
_loggerLevel :
|
||||||
|
type : 'string'
|
||||||
|
default : 'warn'
|
||||||
|
description : 'Set the level for the logger'
|
||||||
|
enum : ['verbose', 'debug', 'info', 'warn', 'error']
|
||||||
|
beautifyEntireFileOnSave :
|
||||||
|
type : 'boolean'
|
||||||
|
default : true
|
||||||
|
description : "When beautifying on save, use the entire file, even if there is selected text in the editor"
|
||||||
|
muteUnsupportedLanguageErrors :
|
||||||
|
type : 'boolean'
|
||||||
|
default : false
|
||||||
|
description : "Do not show \"Unsupported Language\" errors when they occur"
|
||||||
|
muteAllErrors :
|
||||||
|
type : 'boolean'
|
||||||
|
default : false
|
||||||
|
description : "Do not show any/all errors when they occur"
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
# Get Atom defaults
|
# Get Atom defaults
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
tabLength = atom?.config.get('editor.tabLength') ? 4
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
softTabs = atom?.config.get('editor.softTabs') ? true
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
defaultIndentSize = (if softTabs then tabLength else 1)
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
defaultIndentChar = (if softTabs then " " else "\t")
|
||||||
defaultIndentWithTabs = not softTabs
|
defaultIndentWithTabs = not softTabs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Get Atom defaults
|
# Get Atom defaults
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
tabLength = atom?.config.get('editor.tabLength') ? 4
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
softTabs = atom?.config.get('editor.softTabs') ? true
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
defaultIndentSize = (if softTabs then tabLength else 1)
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
defaultIndentChar = (if softTabs then " " else "\t")
|
||||||
defaultIndentWithTabs = not softTabs
|
defaultIndentWithTabs = not softTabs
|
||||||
|
|
|
@ -6,13 +6,6 @@ Language Support and default options.
|
||||||
_ = require('lodash')
|
_ = require('lodash')
|
||||||
extend = null
|
extend = null
|
||||||
|
|
||||||
# Get Atom defaults
|
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
|
||||||
defaultIndentWithTabs = not softTabs
|
|
||||||
|
|
||||||
#
|
#
|
||||||
module.exports = class Languages
|
module.exports = class Languages
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Get Atom defaults
|
# Get Atom defaults
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
tabLength = atom?.config.get('editor.tabLength') ? 4
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
softTabs = atom?.config.get('editor.softTabs') ? true
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
defaultIndentSize = (if softTabs then tabLength else 1)
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
defaultIndentChar = (if softTabs then " " else "\t")
|
||||||
defaultIndentWithTabs = not softTabs
|
defaultIndentWithTabs = not softTabs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Get Atom defaults
|
# Get Atom defaults
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
tabLength = atom?.config.get('editor.tabLength') ? 4
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
softTabs = atom?.config.get('editor.softTabs') ? true
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
defaultIndentSize = (if softTabs then tabLength else 1)
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
defaultIndentChar = (if softTabs then " " else "\t")
|
||||||
defaultIndentWithTabs = not softTabs
|
defaultIndentWithTabs = not softTabs
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Get Atom defaults
|
# Get Atom defaults
|
||||||
tabLength = atom.config.get('editor.tabLength')
|
tabLength = atom?.config.get('editor.tabLength') ? 4
|
||||||
softTabs = atom.config.get('editor.softTabs')
|
softTabs = atom?.config.get('editor.softTabs') ? true
|
||||||
defaultIndentSize = (if softTabs then tabLength else 1)
|
defaultIndentSize = (if softTabs then tabLength else 1)
|
||||||
defaultIndentChar = (if softTabs then " " else "\t")
|
defaultIndentChar = (if softTabs then " " else "\t")
|
||||||
defaultIndentWithTabs = not softTabs
|
defaultIndentWithTabs = not softTabs
|
||||||
|
|
|
@ -9,13 +9,12 @@ module.exports = do ->
|
||||||
# See http://stackoverflow.com/a/21583831/2578205
|
# See http://stackoverflow.com/a/21583831/2578205
|
||||||
winston = require('winston')
|
winston = require('winston')
|
||||||
stream = require('stream')
|
stream = require('stream')
|
||||||
writable = new stream.Writable({
|
writable = new stream.Writable()
|
||||||
write: (chunk, encoding, next) ->
|
writable._write = (chunk, encoding, next) ->
|
||||||
msg = chunk.toString()
|
msg = chunk.toString()
|
||||||
# console.log(msg)
|
# console.log(msg)
|
||||||
emitter.emit('logging', msg)
|
emitter.emit('logging', msg)
|
||||||
next()
|
next()
|
||||||
})
|
|
||||||
|
|
||||||
levels = {
|
levels = {
|
||||||
silly: 0,
|
silly: 0,
|
||||||
|
@ -48,7 +47,7 @@ module.exports = do ->
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
wlogger.on('logging', (transport, level, msg, meta)->
|
wlogger.on('logging', (transport, level, msg, meta)->
|
||||||
loggerLevel = atom.config.get('atom-beautify._loggerLevel')
|
loggerLevel = atom?.config.get('atom-beautify._loggerLevel') ? "warn"
|
||||||
# console.log('logging', loggerLevel, arguments)
|
# console.log('logging', loggerLevel, arguments)
|
||||||
loggerLevelNum = levels[loggerLevel]
|
loggerLevelNum = levels[loggerLevel]
|
||||||
levelNum = levels[level]
|
levelNum = levels[level]
|
||||||
|
|
Loading…
Reference in New Issue