mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
Assign config schema on Atom environment construction
This commit is contained in:
parent
4ca09ef7d3
commit
0f5483a2ed
@ -52,7 +52,7 @@ describe "the `atom` global", ->
|
||||
expect(releaseVersion).toBe 'version'
|
||||
|
||||
describe "loading default config", ->
|
||||
it 'loads the default core config', ->
|
||||
it 'loads the default core config schema', ->
|
||||
expect(atom.config.get('core.excludeVcsIgnoredPaths')).toBe true
|
||||
expect(atom.config.get('core.followSymlinks')).toBe true
|
||||
expect(atom.config.get('editor.showInvisibles')).toBe false
|
||||
|
@ -126,7 +126,6 @@ beforeEach ->
|
||||
# reset config before each spec; don't load or save from/to `config.json`
|
||||
spyOn(atom.config, 'load')
|
||||
spyOn(atom.config, 'save')
|
||||
atom.loadConfig()
|
||||
atom.config.set "core.destroyEmptyPanes", false
|
||||
atom.config.set "editor.fontFamily", "Courier"
|
||||
atom.config.set "editor.fontSize", 16
|
||||
@ -157,8 +156,6 @@ beforeEach ->
|
||||
addCustomMatchers(this)
|
||||
|
||||
afterEach ->
|
||||
atom.reset()
|
||||
|
||||
atom.packages.deactivatePackages()
|
||||
atom.menu.template = []
|
||||
atom.contextMenu.clear()
|
||||
@ -175,6 +172,7 @@ afterEach ->
|
||||
atom.themes.removeStylesheet('global-editor-styles')
|
||||
|
||||
delete atom.state.packageStates
|
||||
atom.reset()
|
||||
|
||||
document.getElementById('jasmine-content').innerHTML = '' unless window.debugContent
|
||||
|
||||
|
@ -160,6 +160,7 @@ class Atom extends Model
|
||||
|
||||
Config = require './config'
|
||||
@config = new Config({configDirPath, resourcePath, notificationManager: @notifications})
|
||||
@setConfigSchema()
|
||||
|
||||
KeymapManager = require './keymap-extensions'
|
||||
@keymaps = new KeymapManager({configDirPath, resourcePath, notificationManager: @notifications})
|
||||
@ -204,6 +205,9 @@ class Atom extends Model
|
||||
registerDefaultCommands = require './register-default-commands'
|
||||
registerDefaultCommands(@commands)
|
||||
|
||||
setConfigSchema: ->
|
||||
@config.setSchema null, {type: 'object', properties: _.clone(require('./config-schema'))}
|
||||
|
||||
registerDeserializersAndViewProviders: ->
|
||||
Workspace = require './workspace'
|
||||
PaneContainer = require './pane-container'
|
||||
@ -240,6 +244,7 @@ class Atom extends Model
|
||||
|
||||
reset: ->
|
||||
@config.reset()
|
||||
@setConfigSchema()
|
||||
|
||||
# Sets up the basic services that should be available in all modes
|
||||
# (both spec and application).
|
||||
@ -566,7 +571,8 @@ class Atom extends Model
|
||||
commandInstaller.installApmCommand false, (error) ->
|
||||
console.warn error.message if error?
|
||||
|
||||
@loadConfig()
|
||||
@config.load()
|
||||
|
||||
@themes.loadBaseStylesheets()
|
||||
|
||||
@setBodyPlatformClass()
|
||||
@ -747,10 +753,6 @@ class Atom extends Model
|
||||
@deserializeProject()
|
||||
@deserializeWorkspace()
|
||||
|
||||
loadConfig: ->
|
||||
@config.setSchema null, {type: 'object', properties: _.clone(require('./config-schema'))}
|
||||
@config.load()
|
||||
|
||||
loadThemes: ->
|
||||
@themes.load()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user