tree-sitter/tree-sitter-php

JS highliting

Closed this issue · 2 comments

Hello,
It appears that Javasscript code is not highlighting correctly?
image

info
NVIM v0.7.0-dev+923-gecec95712
Build type: Release

IMO this is related to #119. The problem is that the parser only ever "sees" the incomplete HTML snippets between PHP tags. Like in your case for example:

  • <script src=": parsed correctly as partial HTML tag
  • /assets/js/custom/d3.js"</script>: can not be parsed as valid HTML

To verify: If you remove the lines 1-4 everything should be fine again.

From what I found there's no fix with nvim-treesitter yet. It could be fixed with the @combined feature which according to this comment still has issues.

yes, you are absolutely right here, thank you, will monitor issue you mentioned. Thank you, closing this as not really problem with this package.