diff --git a/src/config.coffee b/src/config.coffee index f0a24bb49..0fb61f286 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -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 diff --git a/src/language-mode.coffee b/src/language-mode.coffee index 89d9130c8..32112309e 100644 --- a/src/language-mode.coffee +++ b/src/language-mode.coffee @@ -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 diff --git a/src/syntax.coffee b/src/syntax.coffee index c472ee45d..852b48656 100644 --- a/src/syntax.coffee +++ b/src/syntax.coffee @@ -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)