See #713. Extract General options from package settings
This commit is contained in:
parent
2be35ca657
commit
74526b6821
|
@ -121,7 +121,7 @@ module.exports = class Gherkin extends Beautifier
|
|||
lexer = new Lexer(recorder)
|
||||
lexer.scan(text)
|
||||
|
||||
loggerLevel = atom?.config.get('atom-beautify._loggerLevel')
|
||||
loggerLevel = atom?.config.get('atom-beautify.general.loggerLevel')
|
||||
if loggerLevel is 'verbose'
|
||||
for line in recorder.lines
|
||||
logger.verbose("> #{line}")
|
||||
|
|
|
@ -453,20 +453,20 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
)
|
||||
|
||||
# Check if Analytics is enabled
|
||||
if atom.config.get("atom-beautify.analytics")
|
||||
if atom.config.get("atom-beautify.general.analytics")
|
||||
|
||||
# Setup Analytics
|
||||
analytics = new Analytics(analyticsWriteKey)
|
||||
unless atom.config.get("atom-beautify._analyticsUserId")
|
||||
unless atom.config.get("atom-beautify.general.analyticsUserId")
|
||||
uuid = require("node-uuid")
|
||||
atom.config.set "atom-beautify._analyticsUserId", uuid.v4()
|
||||
atom.config.set "atom-beautify.general.analyticsUserId", uuid.v4()
|
||||
|
||||
# Setup Analytics User Id
|
||||
userId = atom.config.get("atom-beautify._analyticsUserId")
|
||||
userId = atom.config.get("atom-beautify.general.analyticsUserId")
|
||||
analytics.identify userId : userId
|
||||
version = pkg.version
|
||||
analytics.track
|
||||
userId : atom.config.get("atom-beautify._analyticsUserId")
|
||||
userId : atom.config.get("atom-beautify.general.analyticsUserId")
|
||||
event : "Beautify"
|
||||
properties :
|
||||
language : language?.name
|
||||
|
@ -478,7 +478,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
category : version
|
||||
|
||||
if unsupportedGrammar
|
||||
if atom.config.get("atom-beautify.muteUnsupportedLanguageErrors")
|
||||
if atom.config.get("atom-beautify.general.muteUnsupportedLanguageErrors")
|
||||
return resolve( null )
|
||||
else
|
||||
repoBugsUrl = pkg.bugs.url
|
||||
|
|
|
@ -58,7 +58,7 @@ beautifier.on('beautify::end', ->
|
|||
)
|
||||
# Show error
|
||||
showError = (error) ->
|
||||
if not atom.config.get("atom-beautify.muteAllErrors")
|
||||
if not atom.config.get("atom-beautify.general.muteAllErrors")
|
||||
# console.log(e)
|
||||
stack = error.stack
|
||||
detail = error.description or error.message
|
||||
|
@ -84,7 +84,7 @@ beautify = ({onSave}) ->
|
|||
|
||||
# Continue beautifying
|
||||
path ?= require("path")
|
||||
forceEntireFile = onSave and atom.config.get("atom-beautify.beautifyEntireFileOnSave")
|
||||
forceEntireFile = onSave and atom.config.get("atom-beautify.general.beautifyEntireFileOnSave")
|
||||
|
||||
# Get the path to the config file
|
||||
# All of the options
|
||||
|
|
|
@ -15,12 +15,12 @@ module.exports = {
|
|||
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 :
|
||||
analyticsUserId :
|
||||
title: 'Analytics User Id'
|
||||
type : 'string'
|
||||
default : ""
|
||||
description : "Unique identifier for this user for tracking usage analytics"
|
||||
_loggerLevel :
|
||||
loggerLevel :
|
||||
title: "Logger Level"
|
||||
type : 'string'
|
||||
default : 'warn'
|
||||
|
|
Loading…
Reference in New Issue