]> git.eshelyaron.com Git - emacs.git/commit
Font-lock JSX while editing it by extending regions
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Mon, 18 Feb 2019 05:16:13 +0000 (21:16 -0800)
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>
Tue, 9 Apr 2019 05:48:21 +0000 (22:48 -0700)
commit4d2b5bbfebc040ca477f1156b44989b4e19bbc3e
treebaf41c198d666df2175fa13b74060860d1d95d7c
parent52a3113b9beae6672c4bc981ee0c7bcc84ee58b5
Font-lock JSX while editing it by extending regions

* lisp/progmodes/js.el (js-jsx--font-lock-keywords):
Call tag beginning and end matchers.
(js-jsx--match-tag-beg, js-jsx--match-tag-end): New functions.
(js-jsx--syntax-propertize-tag): Record buffer positions of JSXElement
beginning and end for font-locking.

(js--syntax-propertize-extend-region)
(js-jsx--syntax-propertize-extend-region): New functions for extending
the syntax-propertize region backwards to the start of a JSXElement so
its JSXAttribute children on its n+1th lines can be parsed as such
while editing those lines.
(js-mode): Add js--syntax-propertize-extend-region to
syntax-propertize-extend-region-functions.
lisp/progmodes/js.el