mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Doc TextMateScopeSelector
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
PEG = require 'pegjs'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
# Public: Test a stack of scopes to see if they match a scope selector.
|
||||
module.exports =
|
||||
class TextMateScopeSelector
|
||||
@parser: null
|
||||
@@ -14,8 +15,16 @@ class TextMateScopeSelector
|
||||
source: null
|
||||
matcher: null
|
||||
|
||||
# Public: Create a new scope selector.
|
||||
#
|
||||
# source - A {String} to parse as a scope selector.
|
||||
constructor: (@source) ->
|
||||
@matcher = TextMateScopeSelector.createParser().parse(@source)
|
||||
|
||||
# Public: Check if this scope selector matches the scopes.
|
||||
#
|
||||
# scopes - An {Array} of {String}s.
|
||||
#
|
||||
# Return a {Boolean}.
|
||||
matches: (scopes) ->
|
||||
@matcher.matches(scopes)
|
||||
|
||||
Reference in New Issue
Block a user