diff --git a/examples/nested-jsbeautifyrc/cpp/expected/test.h b/examples/nested-jsbeautifyrc/cpp/expected/test.h
index dddb88b..f37e3e0 100644
--- a/examples/nested-jsbeautifyrc/cpp/expected/test.h
+++ b/examples/nested-jsbeautifyrc/cpp/expected/test.h
@@ -1,11 +1,10 @@
class Example
{
-Example()
- : member(0)
-{
-}
+ Example()
+ : member(0)
+{}
-int member;
+ int member;
};
diff --git a/examples/simple-jsbeautifyrc/css/expected/indent_char_test.css b/examples/nested-jsbeautifyrc/css/expected/indent_char_test.css
similarity index 100%
rename from examples/simple-jsbeautifyrc/css/expected/indent_char_test.css
rename to examples/nested-jsbeautifyrc/css/expected/indent_char_test.css
diff --git a/examples/simple-jsbeautifyrc/css/original/indent_char_test.css b/examples/nested-jsbeautifyrc/css/original/indent_char_test.css
similarity index 100%
rename from examples/simple-jsbeautifyrc/css/original/indent_char_test.css
rename to examples/nested-jsbeautifyrc/css/original/indent_char_test.css
diff --git a/examples/simple-jsbeautifyrc/handlebars/expected/test.hbs b/examples/nested-jsbeautifyrc/handlebars/expected/test.hbs
similarity index 100%
rename from examples/simple-jsbeautifyrc/handlebars/expected/test.hbs
rename to examples/nested-jsbeautifyrc/handlebars/expected/test.hbs
diff --git a/examples/simple-jsbeautifyrc/handlebars/original/test.hbs b/examples/nested-jsbeautifyrc/handlebars/original/test.hbs
similarity index 100%
rename from examples/simple-jsbeautifyrc/handlebars/original/test.hbs
rename to examples/nested-jsbeautifyrc/handlebars/original/test.hbs
diff --git a/examples/simple-jsbeautifyrc/less/expected/test.less b/examples/nested-jsbeautifyrc/less/expected/test.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/expected/test.less
rename to examples/nested-jsbeautifyrc/less/expected/test.less
diff --git a/examples/simple-jsbeautifyrc/less/expected/test2.less b/examples/nested-jsbeautifyrc/less/expected/test2.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/expected/test2.less
rename to examples/nested-jsbeautifyrc/less/expected/test2.less
diff --git a/examples/simple-jsbeautifyrc/less/expected/test3.less b/examples/nested-jsbeautifyrc/less/expected/test3.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/expected/test3.less
rename to examples/nested-jsbeautifyrc/less/expected/test3.less
diff --git a/examples/simple-jsbeautifyrc/less/expected/test4.less b/examples/nested-jsbeautifyrc/less/expected/test4.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/expected/test4.less
rename to examples/nested-jsbeautifyrc/less/expected/test4.less
diff --git a/examples/simple-jsbeautifyrc/less/expected/test5.less b/examples/nested-jsbeautifyrc/less/expected/test5.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/expected/test5.less
rename to examples/nested-jsbeautifyrc/less/expected/test5.less
diff --git a/examples/simple-jsbeautifyrc/less/original/test.less b/examples/nested-jsbeautifyrc/less/original/test.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/original/test.less
rename to examples/nested-jsbeautifyrc/less/original/test.less
diff --git a/examples/simple-jsbeautifyrc/less/original/test2.less b/examples/nested-jsbeautifyrc/less/original/test2.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/original/test2.less
rename to examples/nested-jsbeautifyrc/less/original/test2.less
diff --git a/examples/simple-jsbeautifyrc/less/original/test3.less b/examples/nested-jsbeautifyrc/less/original/test3.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/original/test3.less
rename to examples/nested-jsbeautifyrc/less/original/test3.less
diff --git a/examples/simple-jsbeautifyrc/less/original/test4.less b/examples/nested-jsbeautifyrc/less/original/test4.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/original/test4.less
rename to examples/nested-jsbeautifyrc/less/original/test4.less
diff --git a/examples/simple-jsbeautifyrc/less/original/test5.less b/examples/nested-jsbeautifyrc/less/original/test5.less
similarity index 100%
rename from examples/simple-jsbeautifyrc/less/original/test5.less
rename to examples/nested-jsbeautifyrc/less/original/test5.less
diff --git a/examples/simple-jsbeautifyrc/mustache/expected/test.mustache b/examples/nested-jsbeautifyrc/mustache/expected/test.mustache
similarity index 80%
rename from examples/simple-jsbeautifyrc/mustache/expected/test.mustache
rename to examples/nested-jsbeautifyrc/mustache/expected/test.mustache
index 105a550..efb4c8a 100644
--- a/examples/simple-jsbeautifyrc/mustache/expected/test.mustache
+++ b/examples/nested-jsbeautifyrc/mustache/expected/test.mustache
@@ -4,7 +4,8 @@
{{#items}}
{{#first}}
-
{{name}}
+
+ {{name}}
{{/first}}
{{#link}}
diff --git a/examples/simple-jsbeautifyrc/mustache/original/test.mustache b/examples/nested-jsbeautifyrc/mustache/original/test.mustache
similarity index 100%
rename from examples/simple-jsbeautifyrc/mustache/original/test.mustache
rename to examples/nested-jsbeautifyrc/mustache/original/test.mustache
diff --git a/examples/simple-jsbeautifyrc/sass/expected/alphasort1.scss b/examples/nested-jsbeautifyrc/sass/expected/alphasort1.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/expected/alphasort1.scss
rename to examples/nested-jsbeautifyrc/sass/expected/alphasort1.scss
diff --git a/examples/simple-jsbeautifyrc/sass/expected/interpolated-text-vars.scss b/examples/nested-jsbeautifyrc/sass/expected/interpolated-text-vars.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/expected/interpolated-text-vars.scss
rename to examples/nested-jsbeautifyrc/sass/expected/interpolated-text-vars.scss
diff --git a/examples/simple-jsbeautifyrc/sass/expected/test.sass b/examples/nested-jsbeautifyrc/sass/expected/test.sass
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/expected/test.sass
rename to examples/nested-jsbeautifyrc/sass/expected/test.sass
diff --git a/examples/simple-jsbeautifyrc/sass/expected/test.scss b/examples/nested-jsbeautifyrc/sass/expected/test.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/expected/test.scss
rename to examples/nested-jsbeautifyrc/sass/expected/test.scss
diff --git a/examples/simple-jsbeautifyrc/sass/original/alphasort1.scss b/examples/nested-jsbeautifyrc/sass/original/alphasort1.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/original/alphasort1.scss
rename to examples/nested-jsbeautifyrc/sass/original/alphasort1.scss
diff --git a/examples/simple-jsbeautifyrc/sass/original/interpolated-text-vars.scss b/examples/nested-jsbeautifyrc/sass/original/interpolated-text-vars.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/original/interpolated-text-vars.scss
rename to examples/nested-jsbeautifyrc/sass/original/interpolated-text-vars.scss
diff --git a/examples/simple-jsbeautifyrc/sass/original/test.sass b/examples/nested-jsbeautifyrc/sass/original/test.sass
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/original/test.sass
rename to examples/nested-jsbeautifyrc/sass/original/test.sass
diff --git a/examples/simple-jsbeautifyrc/sass/original/test.scss b/examples/nested-jsbeautifyrc/sass/original/test.scss
similarity index 100%
rename from examples/simple-jsbeautifyrc/sass/original/test.scss
rename to examples/nested-jsbeautifyrc/sass/original/test.scss
diff --git a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-2.md b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-2.md
index 0f6a69a..0c10507 100644
--- a/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-2.md
+++ b/examples/simple-jsbeautifyrc/markdown/expected/yaml-front-matter-2.md
@@ -5,3 +5,4 @@ title: "This is a title!"
stuff
more stuff
+
diff --git a/lib/beautify.coffee b/lib/beautify.coffee
index 2d12288..07ba120 100644
--- a/lib/beautify.coffee
+++ b/lib/beautify.coffee
@@ -222,13 +222,37 @@ handleSaveEvent = =>
{Subscriber} = require path.join(atom.packages.resourcePath, 'node_modules', 'emissary')
Subscriber.extend plugin
-plugin.configDefaults = _.merge(
- analytics: true
- beautifyOnSave: false
- beautifyEntireFileOnSave: true
- muteUnsupportedLanguageErrors: false
- muteAllErrors: false
- disabledLanguages: []
+plugin.config = _.merge(
+ 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"
+ beautifyOnSave:
+ 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"
+ disabledLanguages:
+ type: 'array'
+ default: []
+ items:
+ type: 'string'
+ description: "An array of languages/grammars to disable Beautification for"
, defaultLanguageOptions)
plugin.activate = ->
handleSaveEvent()
diff --git a/lib/langs/uncrustify/index.coffee b/lib/langs/uncrustify/index.coffee
index 5633a71..e11d7c1 100644
--- a/lib/langs/uncrustify/index.coffee
+++ b/lib/langs/uncrustify/index.coffee
@@ -30,9 +30,12 @@ getCmd = (inputPath, outputPath, options, cb) ->
else
# Has custom config path
editor = atom.workspace.getActiveEditor()
- basePath = path.dirname(editor.getPath())
- # console.log(basePath);
- configPath = path.resolve(basePath, configPath)
- done configPath
+ if editor?
+ basePath = path.dirname(editor.getPath())
+ # console.log(basePath);
+ configPath = path.resolve(basePath, configPath)
+ done configPath
+ else
+ cb(new Error("No Uncrustify Config Path set! Please configure Uncrustify with Atom Beautify."))
return
module.exports = cliBeautify(getCmd)
diff --git a/lib/language-options.coffee b/lib/language-options.coffee
index e121e15..58fe490 100644
--- a/lib/language-options.coffee
+++ b/lib/language-options.coffee
@@ -30,6 +30,15 @@ pkg = require("../package.json")
# Analytics
analyticsWriteKey = "u3c26xkae8"
+
+# 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 =
# Supported unique configuration keys
@@ -62,93 +71,317 @@ module.exports =
# jshint ignore: start
# JavaScript
- js_indent_size: 2
- js_indent_char: " "
- js_indent_level: 0
- js_indent_with_tabs: false
- js_preserve_newlines: true
- js_max_preserve_newlines: 10
- js_jslint_happy: false
- js_brace_style: "collapse"
- js_keep_array_indentation: false
- js_keep_function_indentation: false
- js_space_before_conditional: true
- js_break_chained_methods: false
- js_eval_code: false
- js_unescape_strings: false
- js_wrap_line_length: 0
+ js_indent_size:
+ type: 'integer'
+ default: defaultIndentSize
+ minimum: 0
+ description: "Indentation size/length"
+ js_indent_char:
+ type: 'string'
+ default: defaultIndentChar
+ minimum: 0
+ description: "Indentation character"
+ js_indent_level:
+ type: 'integer'
+ default: 0
+ description: "Initial indentation level"
+ js_indent_with_tabs:
+ type: 'boolean'
+ default: defaultIndentWithTabs
+ description: "Indentation uses tabs, overrides `Indent Size` and `Indent Char`"
+ js_preserve_newlines:
+ type: 'boolean'
+ default: true
+ description: "Preserve line-breaks"
+ js_max_preserve_newlines:
+ type: 'integer'
+ default: 10
+ description: "Number of line-breaks to be preserved in one chunk"
+ js_space_in_paren:
+ type: 'boolean'
+ default: false
+ description: "Add padding spaces within paren, ie. f( a, b )"
+ js_jslint_happy:
+ type: 'boolean'
+ default: false
+ description: "Enable jslint-stricter mode"
+ js_space_after_anon_function:
+ type: 'boolean'
+ default: false
+ description: "Add a space before an anonymous function's parens, ie. function ()"
+ js_brace_style:
+ type: 'string'
+ default: "collapse"
+ enum: ["collapse", "expand", "end-expand", "none"]
+ description: "[collapse|expand|end-expand|none]"
+ js_break_chained_methods:
+ type: 'boolean'
+ default: false
+ description: "Break chained method calls across subsequent lines"
+ js_keep_array_indentation:
+ type: 'boolean'
+ default: false
+ description: "Preserve array indentation"
+ js_keep_function_indentation:
+ type: 'boolean'
+ default: false
+ description: ""
+ js_space_before_conditional:
+ type: 'boolean'
+ default: true
+ description: ""
+ js_eval_code:
+ type: 'boolean'
+ default: false
+ description: ""
+ js_unescape_strings:
+ type: 'boolean'
+ default: false
+ description: "Decode printable characters encoded in xNN notation"
+ js_wrap_line_length:
+ type: 'integer'
+ default: 0
+ description: "Wrap lines at next opportunity after N characters"
+ js_end_with_newline:
+ type: 'boolean'
+ default: false
+ description: "End output with newline"
# CSS
- css_indent_size: 2
- css_indent_char: " "
+ css_indent_size:
+ type: 'integer'
+ default: defaultIndentSize
+ minimum: 0
+ description: "Indentation size/length"
+ css_indent_char:
+ type: 'string'
+ default: defaultIndentChar
+ minimum: 0
+ description: "Indentation character"
+ css_selector_separator_newline:
+ type: 'boolean'
+ default: false
+ description: "Add a newline between multiple selectors"
+ css_newline_between_rules:
+ type: 'boolean'
+ default: false
+ description: "Add a newline between CSS rules"
# HTML
- html_indent_inner_html: false
- html_indent_size: 2
- html_indent_char: " "
- html_brace_style: "collapse"
- html_indent_scripts: "normal"
- html_wrap_line_length: 250
+ html_indent_inner_html:
+ type: 'boolean'
+ default: false
+ description: "Indent and sections."
+ html_indent_size:
+ type: 'integer'
+ default: defaultIndentSize
+ minimum: 0
+ description: "Indentation size/length"
+ html_indent_char:
+ type: 'string'
+ default: defaultIndentChar
+ minimum: 0
+ description: "Indentation character"
+ html_brace_style:
+ type: 'string'
+ default: "collapse"
+ enum: ["collapse", "expand", "end-expand", "none"]
+ description: "[collapse|expand|end-expand|none]"
+ html_indent_scripts:
+ type: 'string'
+ default: "normal"
+ enum: ["keep", "separate", "normal"]
+ description: "[keep|separate|normal]"
+ html_wrap_line_length:
+ type: 'integer'
+ default: 250
+ description: "Maximum characters per line (0 disables)"
+ html_preserve_newlines:
+ type: 'boolean'
+ default: true
+ description: "Preserve line-breaks"
+ html_max_preserve_newlines:
+ type: 'integer'
+ default: 10
+ description: "Number of line-breaks to be preserved in one chunk"
+ html_unformatted:
+ type: 'array'
+ default: ['a', 'sub', 'sup', 'b', 'i', 'u']
+ items:
+ type: 'string'
+ description: "List of tags (defaults to inline) that should not be reformatted"
+ html_end_with_newline:
+ type: 'boolean'
+ default: false
+ description: "End output with newline"
# SQL
- sql_indent_size: 2
- sql_keywords: "upper"
- sql_identifiers: "lower"
- sql_sqlformat_path: ""
+ sql_indent_size:
+ type: 'integer'
+ default: defaultIndentSize
+ minimum: 0
+ description: "Indentation size/length"
+ sql_keywords:
+ type: 'string'
+ default: "upper"
+ description: "Change case of keywords"
+ enum: ["lower","upper","capitalize"]
+ sql_identifiers:
+ type: 'string'
+ default: "lower"
+ description: "Change case of identifiers"
+ enum: ["lower","upper","capitalize"]
+ sql_sqlformat_path:
+ type: 'string'
+ default: ""
+ description: "Path to the `sqlformat` CLI executable"
# Markdown
- markdown_pandoc_path: ""
- markdown_yaml_front_matter: true
+ markdown_pandoc_path:
+ type: 'string'
+ default: ""
+ description: "Path to the `pandoc` CLI executable"
+ markdown_yaml_front_matter:
+ type: 'boolean'
+ default: true
+ description: "Should also format YAML Front Matter (Jekyll) in Markdown"
# Perl
- perl_perltidy_path: "perltidy"
- perl_perltidy_profile: ""
+ perl_perltidy_path:
+ type: 'string'
+ default: "perltidy"
+ description: "Path to the `perltidy` CLI executable"
+ perl_perltidy_profile:
+ type: 'string'
+ default: ""
+ description: "Specify a configuration file which will override the default name of .perltidyrc"
# PHP
- php_beautifier_path: ""
- php_filters: ""
- php_directory_filters: ""
+ php_beautifier_path:
+ type: 'string'
+ default: ""
+ description: "Path to the `PHP_Beautifier` CLI executable"
+ php_filters:
+ type: 'string'
+ default: ""
+ description: "Add filter(s). i.e. \"Filter1(setting1=value1,setting2=value2) Filter2()\""
+ php_directory_filters:
+ type: 'string'
+ default: ""
+ description: "Include dirs for filters"
# Python
- python_autopep8_path: ""
- python_max_line_length: 79
- python_indent_size: 4
- python_ignore: ["E24"]
+ python_autopep8_path:
+ type: 'string'
+ default: ""
+ description: "Path to the `autopep8` CLI executable"
+ python_max_line_length:
+ type: 'integer'
+ default: 79
+ description: "set maximum allowed line length"
+ python_indent_size:
+ type: 'integer'
+ default: defaultIndentSize
+ minimum: 0
+ description: "Indentation size/length"
+ python_ignore:
+ type: 'array'
+ default: ["E24"]
+ items:
+ type: 'string'
+ description: "do not fix these errors/warnings"
# Ruby
- ruby_rbeautify_path: ""
+ ruby_rbeautify_path:
+ type: 'string'
+ default: ""
+ description: "Path to the `rbeautify` CLI executable"
# C
- c_uncrustifyPath: ""
- c_configPath: ""
+ c_uncrustifyPath:
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ c_configPath:
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# C++
- cpp_uncrustifyPath: ""
- cpp_configPath: ""
+ cpp_uncrustifyPath:
+ title: "C++ Uncrustify Path"
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ cpp_configPath:
+ title: "C++ Config Path"
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# Objective-C
- objectivec_uncrustifyPath: ""
- objectivec_configPath: ""
+ objectivec_uncrustifyPath:
+ title: "Objective-C Uncrustify Path"
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ objectivec_configPath:
+ title: "Objective-C Config Path"
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# C#
- cs_uncrustifyPath: ""
- cs_configPath: ""
+ cs_uncrustifyPath:
+ title: "C# Uncrustify Path"
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ cs_configPath:
+ title: "C# Config Path"
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# D
- d_uncrustifyPath: ""
- d_configPath: ""
+ d_uncrustifyPath:
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ d_configPath:
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# Java
- java_uncrustifyPath: ""
- java_configPath: ""
+ java_uncrustifyPath:
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ java_configPath:
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# Pawn
- pawn_uncrustifyPath: ""
- pawn_configPath: ""
+ pawn_uncrustifyPath:
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ pawn_configPath:
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# VALA
- vala_uncrustifyPath: ""
- vala_configPath: ""
+ vala_uncrustifyPath:
+ type: 'string'
+ default: ""
+ description: "Path to the `uncrustify` CLI executable"
+ vala_configPath:
+ type: 'string'
+ default: ""
+ description: "Path to uncrustify config file. i.e. uncrustify.cfg"
# jshint ignore: end
diff --git a/lib/options.coffee b/lib/options.coffee
index c5e1c91..ef073dc 100644
--- a/lib/options.coffee
+++ b/lib/options.coffee
@@ -7,7 +7,6 @@ yaml = null
editorconfig = null
beautifier = require("./language-options")
languages = beautifier.languages
-defaultLanguageOptions = beautifier.defaultLanguageOptions
module.exports =
findFileResults: {}
@@ -73,8 +72,8 @@ module.exports =
return proj if proj
return home if @verifyExists(home)
null
- getConfigOptionsFromSettings: (langs, config) ->
- config ?= atom.config.get('atom-beautify')
+ getConfigOptionsFromSettings: (langs) ->
+ config = atom.config.get('atom-beautify')
options = {}
# console.log(langs, config);
# Iterate over keys of the settings
@@ -140,12 +139,9 @@ module.exports =
indent_size: (if softTabs then tabLength else 1)
indent_char: (if softTabs then " " else "\t")
indent_with_tabs: not softTabs
- # From Package Settings
- configOptions = @getConfigOptionsFromSettings(languages)
- else
- # Without editor
- # Use default options for Atom editor
- configOptions = @getConfigOptionsFromSettings(languages, defaultLanguageOptions)
+
+ # From Package Settings
+ configOptions = @getConfigOptionsFromSettings(languages)
# Get configuration in User's Home directory
userHome = @getUserHome()
@@ -195,3 +191,5 @@ module.exports =
editorConfigOptions
]
allOptions = allOptions.concat(projectOptions)
+ # console.log(allOptions)
+ return allOptions
diff --git a/package.json b/package.json
index c3d12c6..b66fa4d 100644
--- a/package.json
+++ b/package.json
@@ -63,14 +63,19 @@
"typescript-formatter": "~0.1.4",
"yaml-front-matter": "^3.2.3"
},
- "activationEvents": [
- "beautify",
- "beautify:beautify-editor",
- "beautify:beautify-file",
- "beautify:beautify-directory",
- "core:save",
- "core:save-as"
- ],
+ "activationCommands": {
+ "atom-workspace": [
+ "beautify:beautify-editor",
+ "core:save",
+ "core:save-as"
+ ],
+ ".tree-view .file .name": [
+ "beautify:beautify-file"
+ ],
+ ".tree-view .directory .name": [
+ "beautify:beautify-directory"
+ ]
+ },
"keywords": [
"atom",
"beautify",
diff --git a/spec/beautify-languages-spec.coffee b/spec/beautify-languages-spec.coffee
index 678df37..229907d 100644
--- a/spec/beautify-languages-spec.coffee
+++ b/spec/beautify-languages-spec.coffee
@@ -25,11 +25,29 @@ describe "BeautifyLanguages", ->
]
beforeEach ->
+ # Install all of the languages
for lang in allLanguages
do (lang) ->
waitsForPromise ->
atom.packages.activatePackage("language-#{lang}")
+ # Activate package
+ waitsForPromise ->
+ activationPromise = atom.packages.activatePackage('atom-beautify')
+ # Force activate package
+ pack = atom.packages.getLoadedPackage("atom-beautify")
+ pack.activateNow()
+ # Return promise
+ return activationPromise
+
+ # Set Uncrustify config path
+ # uncrustifyConfigPath = path.resolve(__dirname, "../examples/nested-jsbeautifyrc/uncrustify.cfg")
+ # uncrustifyLangs = ["c", "cpp", "objectivec", "cs", "d", "java", "pawn", "vala"]
+ # for lang in uncrustifyLangs
+ # do (lang) ->
+ # atom.config.set("atom-beautify.#{lang}_configPath", uncrustifyConfigPath)
+ # expect(atom.config.get("atom-beautify.#{lang}_configPath")).toEqual("TEST")
+
###
Directory structure:
- examples