Parse object settings into colors manually
Esse commit está contido em:
@@ -1106,15 +1106,6 @@ describe "Config", ->
|
||||
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'omg'
|
||||
expect(atom.config.get('foo.bar.str', scope: ['.source.coffee'])).toBe 'ok'
|
||||
|
||||
it "validates any values set before the schema was set", ->
|
||||
atom.config.set('foo.bar.anInt', 'integer')
|
||||
atom.config.setSchema('foo.bar.anInt', {type: 'integer', default: 12})
|
||||
expect(atom.config.get("foo.bar.anInt")).toBe 12
|
||||
|
||||
atom.config.set('foo.bar.aString', 'foo')
|
||||
atom.config.setSchema('foo.bar.aString', {type: 'string', default: 'bar'})
|
||||
expect(atom.config.get("foo.bar.aString")).toBe 'foo'
|
||||
|
||||
describe 'when the value has an "integer" type', ->
|
||||
beforeEach ->
|
||||
schema =
|
||||
|
||||
@@ -798,16 +798,6 @@ class Config
|
||||
@setDefaults(keyPath, @extractDefaultsFromSchema(schema))
|
||||
@setScopedDefaultsFromSchema(keyPath, schema)
|
||||
|
||||
if keyPath
|
||||
value = @get(keyPath)
|
||||
unless value is undefined
|
||||
try
|
||||
@makeValueConformToSchema(keyPath, value)
|
||||
catch error
|
||||
@unset(keyPath)
|
||||
|
||||
return
|
||||
|
||||
load: ->
|
||||
@initializeConfigDirectory()
|
||||
@loadUserConfig()
|
||||
|
||||
@@ -9,6 +9,7 @@ EmitterMixin = require('emissary').Emitter
|
||||
Q = require 'q'
|
||||
{deprecate} = require 'grim'
|
||||
|
||||
Color = require './color'
|
||||
ModuleCache = require './module-cache'
|
||||
ScopedProperties = require './scoped-properties'
|
||||
|
||||
@@ -265,7 +266,10 @@ class Package
|
||||
|
||||
variables = {}
|
||||
for key, value of atom.config.get(@name)
|
||||
if typeof value is 'object' and not (value instanceof Color)
|
||||
value = Color.parse(value)
|
||||
value = value?.toRGBAString?() ? value
|
||||
continue if value?.length is 0
|
||||
variables[key] = value if typeof value in ['number', 'string']
|
||||
variables
|
||||
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário