mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Atom packages can load cson grammars and TextMate packages can't
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
'name': 'Indent'
|
||||
'scope': 'source.gfm'
|
||||
'settings':
|
||||
'increaseIndentPattern': '^\\s*([\\*\\+-])[ \\t]+'
|
||||
@@ -7,6 +7,11 @@
|
||||
'mkdown'
|
||||
'ron'
|
||||
]
|
||||
|
||||
'properties':
|
||||
'editor':
|
||||
'increaseIndentPattern': '^\\s*([\\*\\+-])[ \\t]+'
|
||||
|
||||
'patterns': [
|
||||
{
|
||||
'match': '(?:^|\\s)(\\*\\*[^\\*]+\\*\\*)'
|
||||
@@ -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()
|
||||
@@ -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 = {}
|
||||
|
||||
@@ -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 """
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user