mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Ugh, add settingsForScopeDescriptor back
It’s used by language mode and autocomplete for different things
This commit is contained in:
@@ -707,6 +707,17 @@ class Config
|
||||
.join(' ')
|
||||
@scopedSettingsStore.getPropertyValue(scopeChain, keyPath)
|
||||
|
||||
# TODO: figure out how to change / remove this. The return value is awkward.
|
||||
# * language mode uses it for one thing.
|
||||
# * autocomplete uses it for editor.completions
|
||||
settingsForScopeDescriptor: (scopeDescriptor, keyPath) ->
|
||||
scopeChain = scopeDescriptor
|
||||
.map (scope) ->
|
||||
scope = ".#{scope}" unless scope[0] is '.'
|
||||
scope
|
||||
.join(' ')
|
||||
@scopedSettingsStore.getProperties(scopeChain, keyPath)
|
||||
|
||||
clearScopedSettings: ->
|
||||
@scopedSettingsStore = new ScopedPropertyStore
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ class LanguageMode
|
||||
# Returns an {Array} of the commented {Ranges}.
|
||||
toggleLineCommentsForBufferRows: (start, end) ->
|
||||
scopes = @editor.scopesForBufferPosition([start, 0])
|
||||
properties = atom.config.get(scopes, "editor")
|
||||
return unless properties.commentStart
|
||||
properties = atom.config.settingsForScopeDescriptor(scopes, "editor.commentStart")[0]
|
||||
return unless properties
|
||||
|
||||
commentStartString = properties.commentStart
|
||||
commentEndString = properties.commentEnd
|
||||
commentStartString = _.valueForKeyPath(properties, 'editor.commentStart')
|
||||
commentEndString = _.valueForKeyPath(properties, 'editor.commentEnd')
|
||||
|
||||
return unless commentStartString
|
||||
|
||||
|
||||
@@ -57,4 +57,4 @@ class Syntax extends GrammarRegistry
|
||||
|
||||
propertiesForScope: (scope, keyPath) ->
|
||||
deprecate 'A direct (but private) replacement is available at atom.config.scopedSettingsForScopeDescriptor().'
|
||||
atom.config.scopedSettingsForScopeDescriptor(scope, keyPath)
|
||||
atom.config.settingsForScopeDescriptor(scope, keyPath)
|
||||
|
||||
Reference in New Issue
Block a user