       foldEndPattern: textMateSettings.foldingStopMarker
     )
     { editor: editorProperties } if _.size(editorProperties) > 0
+
+  cssSelectorFromScopeSelector: (scopeSelector) ->
+    @constructor.cssSelectorFromScopeSelector(scopeSelector)
  getScopedProperties: ->
    scopedProperties = []

    for grammar in @grammars when grammar.foldingStopMarker
      scopedProperties.push
        selector: TextMatePackage.cssSelectorForScopeSelector(grammar.scopeName)
        properties: { editor: { foldEndPattern: grammar.foldingStopMarker } }

    if fs.exists(@preferencesPath)
      for preferencePath in fs.list(@preferencesPath)
        plist.parseString fs.read(preferencePath), (e, data) =>
          if e
            console.warn "Failed to parse preference at path '#{preferencePath}'", e.stack
          else
            { scope, settings } = data[0]
            if properties = @translateProperties(settings)
              selector = TextMatePackage.cssSelectorForScopeSelector(scope) if scope?
              scopedProperties.push({selector, properties})
    scopedProperties

  translateProperties: (textMateSettings) ->
    if textMateSettings.shellVariables
      shellVariables = {}
      for {name, value} in textMateSettings.shellVariables

  @testName: (packageName) ->
    /(\.|_|-)tmbundle$/.test(packageName)

  @cssSelectorFromScopeSelector: (scopeSelector) ->
    scopeSelector.split(', ').map((commaFragment) ->
      commaFragment.split(' ').map((spaceFragment) ->
        spaceFragment.split('.').map((dotFragment) ->
