Only allow json and cson grammars

This commit is contained in:
Kevin Sawicki
2014-02-17 09:44:08 -08:00
parent ead21bfc33
commit 53b423496f

View File

@@ -39,14 +39,12 @@ class TextMatePackage extends Package
grammar.deactivate() for grammar in @grammars
atom.syntax.removeProperties(@path)
legalGrammarExtensions: ['plist', 'tmLanguage', 'tmlanguage', 'json', 'cson']
loadGrammars: ->
deferred = Q.defer()
fs.isDirectory @getSyntaxesPath(), (isDirectory) =>
return deferred.resolve() unless isDirectory
fs.list @getSyntaxesPath(), @legalGrammarExtensions, (error, paths) =>
fs.list @getSyntaxesPath(), ['json', 'cson'], (error, paths) =>
if error?
console.log("Error loading grammars of TextMate package '#{@path}':", error.stack, error)
deferred.resolve()