       @storeUnparsedSnippetsByPrefix(snippetsByPrefix, filePath, selector)
     return
 
+  getScopeChain: (object) ->
+    scopesArray = object?.getScopesArray?()
+    scopesArray ?= Array.from(object)
+    scopesArray
+      .map (scope) ->
+        scope = ".#{scope}" unless scope[0] is '.'
+        scope
+      .join(' ')
+
   storeUnparsedSnippetsByPrefix: (value, path, selector) ->
     unparsedSnippets = {}
     unparsedSnippets[selector] = {"snippets": value}

path = require 'path'
{ScopeDescriptor, Emitter, Disposable, CompositeDisposable, File} = require 'atom'
_ = require 'underscore-plus'
async = require 'async'
CSON = require 'season'

      @scopedPropertyStore.removePropertiesForSourceAndSelector(path, scopeSelector)

  parsedSnippetsByPrefixForScope: (descriptor) ->
    unparsedSnippetsByPrefix = @scopedPropertyStore.getPropertyValue(@getScopeChain(descriptor), "snippets")
    unparsedSnippetsByPrefix ?= {}
    snippets = {}
    for prefix, attributes of unparsedSnippetsByPrefix
