virchau13 / tree-sitter-astro

Tree-sitter grammar for the Astro web framework
MIT License
97 stars 8 forks source link

Empty frontmatter makes syntax highlighting inconsistent #5

Closed adnanhashmi09 closed 1 year ago

adnanhashmi09 commented 1 year ago

I have installed all the parsers tsx, typescript and css and have included the file detect script. But the highlighting is not working.

image

:checkhealth output


gitsigns: require("gitsigns.health").check()
========================================================================
  - OK: git version 2.37.3

man: require("man.health").check()
========================================================================
  - OK: plugin/man.vim not in $VIMRUNTIME
  - OK: autoload/man.vim not in $VIMRUNTIME

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - OK: **Go**: `go version go1.19.2 linux/amd64`
  - OK: **cargo**: `cargo 1.61.0 (a028ae4 2022-04-29)`
  - WARNING: **luarocks**: not available
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `8.19.2`
  - OK: **node**: `v16.15.1`
  - OK: **python3**: `Python 3.11.0`
  - OK: **pip3**: `pip 22.2.2 from /usr/lib/python3.11/site-packages/pip (python 3.11)`
  - WARNING: **javac**: not available
  - OK: **java**: `openjdk version "17.0.4.1" 2022-08-12`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on linux-gnu.`
  - OK: **curl**: `curl 7.85.0 (x86_64-redhat-linux-gnu) libcurl/7.85.0 OpenSSL/3.0.5 zlib/1.2.12 brotli/1.0.9 libidn2/2.3.3 libpsl/0.21.1 (+libidn2/2.3.3) libssh/0.10.4/openssl/zlib nghttp2/1.49.0`
  - OK: **gzip**: `gzip 1.12`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-redhat-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Mon 12 Dec 2022 05:27:44 PM IST.

null-ls: require("null-ls.health").check()
========================================================================
  - OK: prettier: the command "prettier" is executable.
  - OK: stylua: the command "stylua" is executable.
  - OK: gofmt: the command "gofmt" is executable.
  - OK: rustfmt: the command "rustfmt" is executable.

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='7001'
  - INFO: $COLORTERM='truecolor'

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 v16.15.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## OS Info:
{
  machine = "x86_64",
  release = "6.0.7-301.fc37.x86_64",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Fri Nov 4 18:35:48 UTC 2022"
}

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

  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}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - WARNING: Could not load Python 3:
    /usr/bin/python3 does not have the "neovim" module.
    python3.10 not found in search path or not executable.
    python3.9 not found in search path or not executable.
    python3.8 not found in search path or not executable.
    python3.7 not found in search path or not executable.
    /usr/bin/python does not have the "neovim" module.
    - ADVICE:
      - See :help |provider-python| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - INFO: Node.js: v16.15.1
  - WARNING: Missing "neovim" npm (or yarn, pnpm) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim
      - Run in shell (if you use pnpm): pnpm install -g neovim
      - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

## Perl provider (optional)
  - WARNING: "Neovim::Ext" cpan module is not installed
    - ADVICE:
      - See :help |provider-perl| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.2.1

## ===== Installed extensions =====

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/adnan/.local/state/nvim/lsp.log
  - INFO: Log size: 12 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for agda: ABI version 13
  - OK: Loaded parser for arduino: ABI version 14
  - OK: Loaded parser for astro: ABI version 13
  - OK: Loaded parser for awk: ABI version 14
  - OK: Loaded parser for bash: ABI version 14
  - OK: Loaded parser for beancount: ABI version 13
  - OK: Loaded parser for bibtex: ABI version 13
  - OK: Loaded parser for blueprint: ABI version 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for c_sharp: ABI version 13
  - OK: Loaded parser for clojure: ABI version 13
  - OK: Loaded parser for cmake: ABI version 14
  - OK: Loaded parser for comment: ABI version 13
  - OK: Loaded parser for commonlisp: ABI version 13
  - OK: Loaded parser for cooklang: ABI version 13
  - OK: Loaded parser for cpp: ABI version 14
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for cuda: ABI version 14
  - OK: Loaded parser for dart: ABI version 13
  - OK: Loaded parser for diff: ABI version 14
  - OK: Loaded parser for dockerfile: ABI version 14
  - OK: Loaded parser for dot: ABI version 13
  - OK: Loaded parser for ebnf: ABI version 14
  - OK: Loaded parser for eex: ABI version 13
  - OK: Loaded parser for elixir: ABI version 14
  - OK: Loaded parser for elm: ABI version 13
  - OK: Loaded parser for elvish: ABI version 14
  - OK: Loaded parser for embedded_template: ABI version 14
  - OK: Loaded parser for erlang: ABI version 14
  - OK: Loaded parser for fennel: ABI version 13
  - OK: Loaded parser for fish: ABI version 14
  - OK: Loaded parser for foam: ABI version 13
  - OK: Loaded parser for fortran: ABI version 13
  - OK: Loaded parser for fusion: ABI version 13
  - OK: Loaded parser for gdscript: ABI version 13
  - OK: Loaded parser for git_rebase: ABI version 14
  - OK: Loaded parser for gitattributes: ABI version 14
  - OK: Loaded parser for gitcommit: ABI version 14
  - OK: Loaded parser for gleam: ABI version 13
  - OK: Loaded parser for glimmer: ABI version 13
  - OK: Loaded parser for glsl: ABI version 14
  - OK: Loaded parser for go: ABI version 14
  - OK: Loaded parser for gomod: ABI version 13
  - OK: Loaded parser for gowork: ABI version 13
  - OK: Loaded parser for graphql: ABI version 13
  - OK: Loaded parser for hack: ABI version 13
  - OK: Loaded parser for haskell: ABI version 14
  - OK: Loaded parser for hcl: ABI version 14
  - OK: Loaded parser for heex: ABI version 14
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for hjson: ABI version 13
  - OK: Loaded parser for hlsl: ABI version 14
  - OK: Loaded parser for hocon: ABI version 14
  - OK: Loaded parser for html: ABI version 13
  - OK: Loaded parser for http: ABI version 13
  - OK: Loaded parser for java: ABI version 13
  - OK: Loaded parser for javascript: ABI version 14
  - OK: Loaded parser for jq: ABI version 13
  - OK: Loaded parser for jsdoc: ABI version 13
  - OK: Loaded parser for json: ABI version 13
  - OK: Loaded parser for json5: ABI version 13
  - OK: Loaded parser for jsonc: ABI version 13
  - OK: Loaded parser for jsonnet: ABI version 13
  - OK: Loaded parser for julia: ABI version 14
  - OK: Loaded parser for kotlin: ABI version 13
  - OK: Loaded parser for lalrpop: ABI version 13
  - OK: Loaded parser for latex: ABI version 14
  - OK: Loaded parser for ledger: ABI version 13
  - OK: Loaded parser for llvm: ABI version 13
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for m68k: ABI version 13
  - OK: Loaded parser for make: ABI version 13
  - OK: Loaded parser for markdown: ABI version 13
  - OK: Loaded parser for markdown_inline: ABI version 13
  - OK: Loaded parser for menhir: ABI version 13
  - OK: Loaded parser for mermaid: ABI version 13
  - OK: Loaded parser for meson: ABI version 14
  - OK: Loaded parser for nickel: ABI version 13
  - OK: Loaded parser for ninja: ABI version 13
  - OK: Loaded parser for nix: ABI version 13
  - OK: Loaded parser for norg: ABI version 14
  - OK: Loaded parser for ocaml: ABI version 13
  - OK: Loaded parser for ocaml_interface: ABI version 13
  - OK: Loaded parser for org: ABI version 14
  - OK: Loaded parser for pascal: ABI version 13
  - OK: Loaded parser for perl: ABI version 13
  - OK: Loaded parser for php: ABI version 14
  - OK: Loaded parser for phpdoc: ABI version 14
  - OK: Loaded parser for pioasm: ABI version 13
  - OK: Loaded parser for prisma: ABI version 13
  - OK: Loaded parser for proto: ABI version 13
  - OK: Loaded parser for pug: ABI version 13
  - OK: Loaded parser for python: ABI version 14
  - OK: Loaded parser for ql: ABI version 13
  - OK: Loaded parser for qmljs: ABI version 14
  - OK: Loaded parser for query: ABI version 14
  - OK: Loaded parser for r: ABI version 13
  - OK: Loaded parser for racket: ABI version 14
  - OK: Loaded parser for rasi: ABI version 13
  - OK: Loaded parser for regex: ABI version 13
  - OK: Loaded parser for rego: ABI version 13
  - OK: Loaded parser for rnoweb: ABI version 13
  - OK: Loaded parser for rst: ABI version 13
  - OK: Loaded parser for ruby: ABI version 13
  - OK: Loaded parser for rust: ABI version 14
  - OK: Loaded parser for scala: ABI version 13
  - OK: Loaded parser for scheme: ABI version 14
  - OK: Loaded parser for scss: ABI version 13
  - OK: Loaded parser for slint: ABI version 13
  - OK: Loaded parser for solidity: ABI version 13
  - OK: Loaded parser for sparql: ABI version 13
  - OK: Loaded parser for sql: ABI version 14
  - OK: Loaded parser for supercollider: ABI version 13
  - OK: Loaded parser for surface: ABI version 13
  - OK: Loaded parser for svelte: ABI version 13
  - OK: Loaded parser for sxhkdrc: ABI version 13
  - OK: Loaded parser for tiger: ABI version 14
  - OK: Loaded parser for tlaplus: ABI version 14
  - OK: Loaded parser for todotxt: ABI version 13
  - OK: Loaded parser for toml: ABI version 13
  - OK: Loaded parser for tsx: ABI version 14
  - OK: Loaded parser for turtle: ABI version 13
  - OK: Loaded parser for twig: ABI version 14
  - OK: Loaded parser for typescript: ABI version 14
  - OK: Loaded parser for v: ABI version 13
  - OK: Loaded parser for vala: ABI version 13
  - OK: Loaded parser for verilog: ABI version 13
  - OK: Loaded parser for vhs: ABI version 14
  - OK: Loaded parser for vim: ABI version 14
  - OK: Loaded parser for vue: ABI version 13
  - OK: Loaded parser for wgsl: ABI version 13
  - OK: Loaded parser for yaml: ABI version 13
  - OK: Loaded parser for yang: ABI version 13
  - OK: Loaded parser for zig: ABI version 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for vim: ABI version 14
virchau13 commented 1 year ago

If you add a statement inside the frontmatter (the three dashes), does it work?

Try running :TSUpdate

adnanhashmi09 commented 1 year ago

It does. image

:TSUpdate doesn't help. It says already up to date. My dotfiles if you wanna take a look: https://github.com/adnanhashmi09/nvim

virchau13 commented 1 year ago

Does it work if you install the html tree-sitter parser?

adnanhashmi09 commented 1 year ago

No it doesn't work. This is my lua config for treesitter.

local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
    return
end

configs.setup({
    ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
    sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
    ignore_install = { "" }, -- List of parsers to ignore installing
    autopairs = {
        enable = true,
    },
    highlight = {
        enable = true, -- false will disable the whole extension
        disable = { "" }, -- list of language that will be disabled
        additional_vim_regex_highlighting = true,
    },
    indent = { enable = true, disable = { "yaml" } },
    context_commentstring = {
        enable = true,
        enable_autocmd = false,
    },
    rainbow = {
        enable = true,
        -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
        extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
        max_file_lines = nil, -- Do not enable for files with more than n lines, int
        -- colors = {}, -- table of hex strings
        -- termcolors = {} -- table of colour name strings
    },
})
virchau13 commented 1 year ago

I believe this is an issue with nvim-treesitter. I experience a similar problem with a minimal configuration; even though my tree-sitter parser outputs the correct nodes, the highlighting is still broken. The weird part is that the highlighting actually fixes itself if you inspect nodes with :TSPlaygroundToggle. I'll report the issue upstream.

As a workaround, just don't use empty frontmatter. Astro files work fine without any frontmatter at all; you only need the frontmatter if you have some serverside JS to execute, in which case the highlighting issue fixes itself anyway.

yamafaktory commented 1 year ago

Hi!

I'm facing a similar issue: treesitter health is ok, all the necessary parsers are present and up-to-date, the file type is perfectly recognized too. I get no syntax highlightling at all on neovim v0.8.2 and a little bit more with a nightly build.

image

virchau13 commented 1 year ago

@yamafaktory

I cannot reproduce with a minimal example: image

Honestly I think your issue is a colorscheme issue: your colorscheme doesn't appear to have many colors. In fact, you can see that the inline JSX interpolations are in italics, suggesting that they are in fact being detected. Are you sure you're using a tree-sitter enabled colorscheme?

yamafaktory commented 1 year ago

@virchau13 I'm using Tokyo night. I assume it works pretty well with tree sitter.

virchau13 commented 1 year ago

@yamafaktory

Yes, it should work. Hmm...

What's your :checkhealth output?

Have you configured nvim-treesitter to enable highlight for "astro"?

Can you send the full file? Maybe there's some invisible characters tripping up the lexer or something.

yamafaktory commented 1 year ago

@virchau13 I'm not in front of my laptop right now but I checked the health output and everything was green. Here's the commit related to my init.lua changes for Astro https://github.com/yamafaktory/.config/commit/13658c367aa27617df6c99c773ed0f3db477ab82.

virchau13 commented 1 year ago

Can you install the nvim-treesitter playground plugin and type :TSPlaygroundToggle while viewing the .astro file? This should display the treesitter AST.

yamafaktory commented 1 year ago

I've created a new dummy Astro project and opened an .astro file.

image

I can walk the AST via the playground node by node and everything seems ok.


crates: require("crates.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary.nvim installed
  - WARNING: null-ls.nvim not found

## Checking for external dependencies
  - OK: curl installed
  - OK: xdg-open installed

gitsigns: require("gitsigns.health").check()
========================================================================
  - OK: git version 2.39.0

lazy: require("lazy.health").check()
========================================================================
## lazy.nvim
  - OK: no existing packages found by other package managers
  - OK: packer_compiled.lua not found

man: require("man.health").check()
========================================================================
  - OK: plugin/man.vim not in $VIMRUNTIME
  - OK: autoload/man.vim not in $VIMRUNTIME

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - WARNING: **Go**: not available
  - OK: **cargo**: `cargo 1.66.0 (d65d197ad 2022-11-15)`
  - WARNING: **luarocks**: not available
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `8.19.2`
  - OK: **node**: `v19.3.0`
  - OK: **python3**: `Python 3.10.9`
  - WARNING: **pip3**: not available
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on linux-gnu.`
  - OK: **curl**: `curl 7.87.0 (x86_64-pc-linux-gnu) libcurl/7.87.0 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.1 (+libidn2/2.3.4) libssh2/1.10.0 nghttp2/1.51.0`
  - OK: **gzip**: `gzip 1.12`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Sat 31 Dec 2022 11:37:09 AM CET.

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v19.3.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 12.2.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## OS Info:
{
  machine = "x86_64",
  release = "6.1.1-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Wed, 21 Dec 2022 22:27:55 +0000"
}

## Parser/Features         H L F I J
  - astro               ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓

  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}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 3 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - WARNING: Could not load Python 3:
    /usr/bin/python3 does not have the "neovim" module.
    /usr/bin/python3.10 does not have the "neovim" module.
    python3.9 not found in search path or not executable.
    python3.8 not found in search path or not executable.
    python3.7 not found in search path or not executable.
    /usr/bin/python does not have the "neovim" module.
    - ADVICE:
      - See :help |provider-python| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
  - INFO: Executable: Not found

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - INFO: Node.js: v19.3.0
  - WARNING: Missing "neovim" npm (or yarn, pnpm) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim
      - Run in shell (if you use pnpm): pnpm install -g neovim
      - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

## Perl provider (optional)
  - WARNING: "Neovim::Ext" cpan module is not installed
    - ADVICE:
      - See :help |provider-perl| for more information.
      - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0
  - OK: fd: found fd 8.6.0

## ===== Installed extensions =====

## Telescope Extension: `file_browser`
  - INFO: No healthcheck provided

## Telescope Extension: `fzf`
  - OK: lib working as expected
  - OK: file_sorter correctly configured
  - OK: generic_sorter correctly configured

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/yamafaktory/.local/state/nvim/lsp.log
  - INFO: Log size: 10982 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for astro: ABI version 14
  - OK: Loaded parser for css: ABI version 13
  - OK: Loaded parser for html: ABI version 13

Maybe something is odd with my neovim setup. Thanks for the swift help & feedback! I'd assume that this is on my side since the AST is fine...I'll give it another shot in the near future. Sorry for polluting this issue :).

virchau13 commented 1 year ago

I don't think this is the correct issue, yeah, but your problem is still worth solving, surely! If only so that I can add the solution to my troubleshooting section in the README :P

There's something extremely suspicious about this:

## Parser/Features         H L F I J
  - astro               ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓

How are there only 3 parsers? Looking at your dotfiles, you have way more than 3 parsers specified under ensure_installed. I think there might be something wrong with your parser installation; what does :TSInstall do?

virchau13 commented 1 year ago

I can't reproduce this anymore on the latest version of Neovim + nvim-treesitter, so I presume it's fixed. Closing for now; feel free to bump if you still encounter this issue.