Atom packages can load cson grammars and TextMate packages can't

This commit is contained in:
Corey Johnson & Nathan Sobo
2013-03-21 13:25:52 -07:00
parent 1929899365
commit 0b719bfecf
20 changed files with 67 additions and 60 deletions

View File

@@ -1,4 +0,0 @@
'name': 'Indent'
'scope': 'source.gfm'
'settings':
'increaseIndentPattern': '^\\s*([\\*\\+-])[ \\t]+'

View File

@@ -7,6 +7,11 @@
'mkdown'
'ron'
]
'properties':
'editor':
'increaseIndentPattern': '^\\s*([\\*\\+-])[ \\t]+'
'patterns': [
{
'match': '(?:^|\\s)(\\*\\*[^\\*]+\\*\\*)'

View File

@@ -1,14 +1,13 @@
fs = require 'fs-utils'
TextMatePackage = require 'text-mate-package'
describe "GitHub Flavored Markdown grammar", ->
grammar = null
beforeEach ->
spyOn(syntax, "addGrammar")
pack = new TextMatePackage(fs.resolveOnLoadPath("gfm.tmbundle"))
pack.load()
grammar = pack.grammars[0]
spyOn(syntax, "addGrammar").andCallThrough()
window.loadPackage("gfm")
expect(syntax.addGrammar).toHaveBeenCalled()
grammar = syntax.addGrammar.argsForCall[0][0]
it "parses the grammar", ->
expect(grammar).toBeTruthy()

View File

@@ -91,7 +91,7 @@ module.exports =
async.eachSeries(paths, loadSnippetFile, done)
translateTextmateSnippet: ({ scope, name, content, tabTrigger }) ->
scope = TextMatePackage.cssSelectorFromScopeSelector(scope) if scope
scope = syntax.cssSelectorFromScopeSelector(scope) if scope
scope ?= '*'
snippetsByScope = {}
snippetsByName = {}

View File

@@ -281,21 +281,6 @@ describe "Snippets extension", ->
expect(console.warn).toHaveBeenCalled()
expect(console.warn.calls.length).toBe 1
it "loads CSON snippets from TextMate packages", ->
jasmine.unspy(snippets, 'loadTextMateSnippets')
spyOn(console, 'warn')
snippets.loaded = false
snippets.loadAll()
waitsFor "CSON snippets to load", 5000, -> snippets.loaded
runs ->
snippet = syntax.getProperty(['.source.alot'], 'snippets.really')
expect(snippet).toBeTruthy()
expect(snippet.prefix).toBe 'really'
expect(snippet.name).toBe 'Really'
expect(snippet.body).toBe "I really like alot"
describe "snippet body parser", ->
it "breaks a snippet body into lines, with each line containing tab stops at the appropriate position", ->
bodyTree = snippets.getBodyParser().parse """

View File

@@ -1,4 +1,3 @@
fs = require 'fs-utils'
TextMatePackage = require 'text-mate-package'
describe "TOML grammar", ->
@@ -6,9 +5,9 @@ describe "TOML grammar", ->
beforeEach ->
spyOn(syntax, "addGrammar")
pack = new TextMatePackage(fs.resolveOnLoadPath("toml.tmbundle"))
pack.load()
grammar = pack.grammars[0]
window.loadPackage("toml")
expect(syntax.addGrammar).toHaveBeenCalled()
grammar = syntax.addGrammar.argsForCall[0][0]
it "parses the grammar", ->
expect(grammar).toBeTruthy()