-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atom Beautify internal API v1.0 #282
Comments
@Botv0091 had a great idea with #286: extract the settings from common Atom Linter packages and use them as beautification settings. The developer API for Atom Beautify could be a |
Also switch to Promises instead of Callback-style. |
Look into using the |
Supported languages should be separated into their own list and then referenced from Beautifiers. A supported Language should have the following:
|
Done: - Create base Beautifier class - All Languages are separate files - Options are separated for each language - Beautifiers reference applicable Languages/Options - Atom Beautify builds and tests can run - 19 failures out of 34 tests TODO: - Render Language Options to Atom Package Settings - Support for Language fallback option namespaces - Support for chosing from multiple applicable beautifiers
Tests are passing! See https://travis-ci.org/Glavin001/atom-beautify/builds/60724610 |
Beautifier can have global language option transforms with "_" (underscore) key.
|
What's new: - Beautifier options definition supports: - boolean - enable/disable - string - rename and enable - function - transform and enable - array - apply complex transformation to multiple options and output single option result - Show "Supported by <beautifiers>" for each language option - Beautifiers have a name - Beautifier options definition is used to determine if language option is supported by a beautifier - Remove SQL test, since sqlformat is inconsistant
Try something like: languages:
type: 'object'
properties:
js_disabled:
type: 'boolean'
default: false
description: 'Disable JavaScript Language beautification'
js_default_beautifier:
type: 'string'
default: 'JS Beautifier'
enum: ['JS Beautifier', 'Pretty Diff'] |
- Was causing "Duplicate option" warnings
|
Language config options for: - disabled - Disable beautifying a language - `disabled_languages` no longer works - use the options for each language to disable them - default_beautifier - Preferred beautifier to use for language - if there are multiple beautifiers for a language it will choose the beautifier the user has set as default. Initially the default beautifier is just the first beautifier to register support for that language
See Atom Settings-View bug: atom/settings-view#386 (comment)
Redesigning the internals of Atom Beautify for performance, extensibility, and ease of use.
Hardcoded CLI paths (see Force hardcoded paths to CLI beautifiers #164 ) - CLI beautifiers onlyBeautifier class methods - to be used by Beautifier registry for filtering, etcfilter(editor, options)getText()getOptions(language)lazy-require(package-name)register(beautifier)Beautifiers must register to be availablebeautifiers
are loaded fromrequire
ingbeautifierNames
If multiple registers are available for this particular file then display them as a listNote that beautifiers that have not set their CLI path option will not be applicable. Therefore if there are multiple applicable CLI beautifiers, only the one that has been setup (CLI path option set) will be returned as availableThe text was updated successfully, but these errors were encountered: