You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if there's no <style> tags in the file, astro-mode attempts to syntax highlight everything outside the frontmatter as if it were CSS.
I've done some digging and I think this is an Emacs bug (unless I'm misunderstanding how I'm supposed to use treesit-range-settings). Will need to come up with a workaround.
Technical explanation
When there's no style_element nodes in the document, treesit-parser-included-ranges returns nil for the CSS range, which makes sense. However, treesit-parser-root-node doesn't seem to return the correct node in this case. I'd expect that it would just return nil, since if there's a nil range (ie. no CSS content in the document), there shouldn't be a root node, but it instead returns a stylesheet node spanning the full range of the document, which doesn't seem correct. Because treesit's font locking applies to the whole root node, it ends up applying CSS highlighting to the whole document.
The text was updated successfully, but these errors were encountered:
Currently, if there's no
<style>
tags in the file, astro-mode attempts to syntax highlight everything outside the frontmatter as if it were CSS.I've done some digging and I think this is an Emacs bug (unless I'm misunderstanding how I'm supposed to use
treesit-range-settings
). Will need to come up with a workaround.Technical explanation
When there's nostyle_element
nodes in the document,treesit-parser-included-ranges
returnsnil
for the CSS range, which makes sense. However,treesit-parser-root-node
doesn't seem to return the correct node in this case. I'd expect that it would just returnnil
, since if there's anil
range (ie. no CSS content in the document), there shouldn't be a root node, but it instead returns astylesheet
node spanning the full range of the document, which doesn't seem correct. Because treesit's font locking applies to the whole root node, it ends up applying CSS highlighting to the whole document.The text was updated successfully, but these errors were encountered: