Store foldEndPattern in syntax global's scoped properties

There's a slight wrinkle in this commit… TextMate grammars sometimes store
the `foldStopMarker` directly in the grammar, rather than storing it
in a separate scoped preferences file like the other settings. So we
have to scan through grammars looking for those that have the fold end
marker and make a scoped property for that grammar's scope.
This commit is contained in:
Nathan Sobo
2012-12-28 14:46:39 -06:00
parent 5a075d515e
commit bb4f3c4efa
4 changed files with 16 additions and 24 deletions

View File

@@ -2,14 +2,6 @@ fs = require('fs')
TextMateBundle = require 'text-mate-bundle'
describe "TextMateBundle", ->
describe ".getPreferenceInScope(scope, preferenceName)", ->
it "returns the preference by the given name in the given scope or undefined if there isn't one", ->
expect(TextMateBundle.getPreferenceInScope('source.coffee', 'decreaseIndentPattern')).toBe '^\\s*(\\}|\\]|else|catch|finally)$'
expect(TextMateBundle.getPreferenceInScope('source.coffee', 'shellVariables')).toBeDefined()
it "returns the preference by the given name in the given scope for a scope registered via a comma-separated list of scopes", ->
expect(TextMateBundle.getPreferenceInScope('source.objc++', 'shellVariables')).toBeDefined()
describe ".getPreferencesByScopeSelector()", ->
it "logs warning, but does not raise errors if a preference can't be parsed", ->
bundlePath = fs.join(require.resolve('fixtures'), "test.tmbundle")