Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Feb 27, 2020
1 parent e2ac540 commit 6f6c06e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,25 @@ Used instead of ``begin`` for modes starting with keywords to avoid needless rep
::

{
begin: '\\b(extends|implements) ',
keywords: 'extends implements'
begin: '\\b(class|interface) ',
keywords: 'class interface'
}

becomes:
can often be shortened to:

::

{
beginKeywords: 'extends implements'
beginKeywords: 'class interface'
}

Unlike the :ref:`keywords <keywords>` attribute, this one allows only a simple list of space separated keywords.
If you do need additional features of ``keywords`` or you just need more keywords for this mode you may include ``keywords`` along with ``beginKeywords``.

Note: ``beginKeywords`` also checks for a ``.`` before or after the keywords and will fail to match if one is found.
This is to avoid false positives for method calls or property accesses.

Ex. ``class A { ... }`` would match while ``A.class == B.class`` would not.

.. _endsWithParent:

Expand Down

0 comments on commit 6f6c06e

Please sign in to comment.