gbprod / tree-sitter-twig

Twig grammar for Tree-sitter
https://gb-prod.fr/tree-sitter-twig/
Do What The F*ck You Want To Public License
41 stars 3 forks source link

Twig highlighting is removed when using empty double quotes #4

Closed KevinNordli closed 2 years ago

KevinNordli commented 2 years ago

Describe the bug

Highlighting for the rest of the file is removed/buggy when wrapping empty strings in double quotes. It does not get removed if using single quotes or if the string is not empty.

Empty string with single quotes: image

Empty string with double quotes: image

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  - OK: `node` found v18.10.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - turtle         ✓ ✓ ✓ ✓ ✓
  - svelte         ✓ . ✓ ✓ ✓
  - beancount      ✓ . ✓ . .
  - gleam          ✓ ✓ ✓ ✓ ✓
  - rnoweb         ✓ . ✓ . ✓
  - eex            ✓ . . . ✓
  - heex           ✓ ✓ ✓ ✓ ✓
  - bibtex         ✓ . ✓ ✓ .
  - python         ✓ ✓ ✓ ✓ ✓
  - ocaml_interface✓ ✓ ✓ . ✓
  - fortran        ✓ . ✓ ✓ .
  - regex          ✓ . . . .
  - menhir         ✓ . . . ✓
  - help           ✓ . . . .
  - org            . . . . .
  - json5          ✓ . . . ✓
  - pioasm         ✓ . . . ✓
  - hjson          ✓ ✓ ✓ ✓ ✓
  - todotxt        ✓ . . . .
  - hocon          ✓ . . . ✓
  - typescript     ✓ ✓ ✓ ✓ ✓
  - llvm           ✓ . . . .
  - meson          ✓ . ✓ . ✓
  - qmljs          ✓ . ✓ . .
  - supercollider  ✓ ✓ ✓ ✓ ✓
  - prisma         ✓ . . . .
  - diff           ✓ . . . .
  - slint          ✓ . . ✓ .
  - rasi           ✓ ✓ ✓ ✓ .
  - haskell        ✓ . ✓ . ✓
  - hack           ✓ . . . .
  - norg           . . . . .
  - embedded_template✓ . . . ✓
  - markdown_inline✓ . . . ✓
  - javascript     ✓ ✓ ✓ ✓ ✓
  - clojure        ✓ ✓ ✓ . ✓
  - tlaplus        ✓ ✓ ✓ . ✓
  - vala           ✓ . ✓ . .
  - bash           ✓ ✓ ✓ . ✓
  - vim            ✓ ✓ ✓ . ✓
  - html           ✓ ✓ ✓ ✓ ✓
  - lalrpop        ✓ ✓ . . .
  - tsx            ✓ ✓ ✓ ✓ ✓
  - cuda           ✓ ✓ ✓ ✓ ✓
  - solidity       ✓ . . . .
  - glimmer        ✓ . . . .
  - pug            ✓ . . . ✓
  - cooklang       ✓ . . . .
  - latex          ✓ . ✓ . ✓
  - v              ✓ ✓ ✓ ✓ ✓
  - dockerfile     ✓ . . . ✓
  - foam           ✓ ✓ ✓ ✓ ✓
  - astro          ✓ ✓ ✓ ✓ ✓
  - markdown       ✓ . ✓ . ✓
  - elm            ✓ . . . ✓
  - wgsl           ✓ . ✓ ✓ .
  - c_sharp        ✓ ✓ ✓ . ✓
  - yang           ✓ . ✓ ✓ .
  - ledger         ✓ . ✓ ✓ ✓
  - agda           ✓ . ✓ . .
  - dart           ✓ ✓ . ✓ ✓
  - tiger          ✓ ✓ ✓ ✓ ✓
  - http           ✓ . . . ✓
  - sxhkdrc        ✓ . ✓ . ✓
  - fennel         ✓ ✓ . . ✓
  - graphql        ✓ . . ✓ ✓
  - nickel         ✓ . . . .
  - ql             ✓ ✓ . ✓ ✓
  - ruby           ✓ ✓ ✓ ✓ ✓
  - perl           ✓ . ✓ . .
  - pascal         ✓ ✓ ✓ ✓ ✓
  - zig            ✓ . ✓ ✓ ✓
  - twig           ✓ . . . ✓
  - phpdoc         ✓ . . . .
  - fish           ✓ ✓ ✓ ✓ ✓
  - php            ✓ ✓ ✓ ✓ ✓
  - jsdoc          ✓ . . . .
  - java           ✓ ✓ . ✓ ✓
  - query          ✓ ✓ ✓ ✓ ✓
  - c              ✓ ✓ ✓ ✓ ✓
  - kotlin         ✓ ✓ ✓ . ✓
  - sparql         ✓ ✓ ✓ ✓ ✓
  - julia          ✓ ✓ ✓ ✓ ✓
  - jsonnet        ✓ . . . .
  - css            ✓ . ✓ ✓ ✓
  - scss           ✓ . . ✓ .
  - erlang         ✓ . ✓ . .
  - elixir         ✓ ✓ ✓ ✓ ✓
  - proto          ✓ . ✓ . .
  - blueprint      ✓ . . . .
  - gitattributes  ✓ . . . ✓
  - cpp            ✓ ✓ ✓ ✓ ✓
  - surface        ✓ . ✓ ✓ ✓
  - cmake          ✓ . ✓ . .
  - json           ✓ ✓ ✓ ✓ .
  - racket         ✓ . ✓ . ✓
  - dot            ✓ . . . ✓
  - vue            ✓ . ✓ ✓ ✓
  - gowork         ✓ . . . ✓
  - gomod          ✓ . . . ✓
  - yaml           ✓ ✓ ✓ ✓ ✓
  - nix            ✓ ✓ ✓ . ✓
  - ninja          ✓ . ✓ ✓ .
  - rst            ✓ ✓ . . ✓
  - commonlisp     ✓ ✓ ✓ . .
  - scheme         ✓ . ✓ . ✓
  - fusion         ✓ ✓ ✓ ✓ .
  - verilog        ✓ ✓ ✓ . ✓
  - rust           ✓ ✓ ✓ ✓ ✓
  - lua            ✓ ✓ ✓ ✓ ✓
  - jsonc          ✓ ✓ ✓ ✓ ✓
  - elvish         ✓ . . . ✓
  - hlsl           ✓ ✓ ✓ ✓ ✓
  - comment        ✓ . . . .
  - glsl           ✓ ✓ ✓ ✓ ✓
  - ocaml          ✓ ✓ ✓ . ✓
  - hcl            ✓ . ✓ ✓ ✓
  - go             ✓ ✓ ✓ ✓ ✓
  - toml           ✓ ✓ ✓ ✓ ✓
  - r              ✓ ✓ . ✓ ✓
  - rego           ✓ . . . ✓
  - sql            ✓ . . . ✓
  - make           ✓ . ✓ . ✓
  - scala          ✓ . ✓ . ✓
  - gdscript       ✓ ✓ . ✓ ✓
  - m68k           ✓ ✓ ✓ . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

Output of nvim --version

NVIM v0.8.0-1210-gd367ed9b2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az505-656

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
gbprod commented 2 years ago

Should be fixed now ! Update nvim-treesitter plugin and run :TSInstall twig.

Thanks for your feedback

KevinNordli commented 2 years ago

Great, thanks!