Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the parser to attach and highlight the .astro file #16

Closed
mrs4ndman opened this issue Jul 7, 2023 · 10 comments
Closed

Can't get the parser to attach and highlight the .astro file #16

mrs4ndman opened this issue Jul 7, 2023 · 10 comments

Comments

@mrs4ndman
Copy link

Great work, as I have seen from the tree-sitter issues related to astro and this repo ;)

  • Have read the issues on the treesitter readme, and nvim-treesitter: Syntax highlighting doesn't work on fresh install #8.
  • Testing on a sample .astro file and project from the Astro website
  • Have installed all indicated parsers (tsx, html and typescript)
  • LSP is working and attaching correctly to the .astro files with a default lspconfig setup.
  • Tried :TSBufEnable, TSInstall astro, TSUninstall astro, the old parsers.lua treesitter mod adding the astro = "astro" line. All other parsers work, and have them installed.
  • Environment: NVIM v0.10.0-dev-642+gc44d819ae, Linux (Pop_OS!), tree-sitter-cli not installed. checkhealth says all OK for everything.
  • Tried reinstalling the treesitter plugin inside lazy and recompiling neovim and all parsers.

Can provide configuration files (currently hosted at this repo
I am a bit at a dead end, so hope I can find some help
Thanks in advance

@virchau13
Copy link
Owner

Looks like you've done quite a bit of debugging already :P

Alright, let's try to isolate the problem.

  1. nvim-treesitter README says that you should install tree-sitter CLI (since you have auto_install = true). Try installing the tree-sitter CLI.
  2. If that still doesn't work, can you try posting the full output of :checkhealth here?

@mrs4ndman
Copy link
Author

Did already have the tree-sitter CLI util installed through Mason. Just tried installing it with the official cargo install tree-sitter-cli and no luck either.

This is my :checkhealth output (I do have all tree-sitter parsers installed) :



==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

==============================================================================
noice: require("noice.health").check()

noice.nvim ~
- OK **Neovim** >= 0.8.0
- OK Not running inside **Neovide**
- OK You're using a GUI that should work ok
- OK **vim.go.lazyredraw** is not enabled
- OK **nvim-notify** is installed
- OK **TreeSitter vim** parser is installed
- OK **TreeSitter regex** parser is installed
- OK **TreeSitter lua** parser is installed
- OK **TreeSitter bash** parser is installed
- OK **TreeSitter markdown** parser is installed
- OK **TreeSitter markdown_inline** parser is installed
- OK `vim.notify` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/hover"]` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/signatureHelp"]` is set to **Noice**
- OK `vim.lsp.handlers["window/showMessage"]` is set to **Noice**
- OK `vim.lsp.util.convert_input_to_markdown_lines` is set to **Noice**
- OK `vim.lsp.util.stylize_markdown` is set to **Noice**

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /usr/share/nvim/runtime

Performance ~
- OK Build type: RelWithDebInfo

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=\177`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="tmux"
- $COLORTERM="truecolor"

tmux ~
- OK escape-time: 0
- OK focus-events: on
- $TERM: screen-256color

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v20.4.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.1) 11.3.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.2.6-76060206-generic",
  sysname = "Linux",
  version = "#202303130630~1685473338~22.04~995127e SMP PREEMPT_DYNAMIC Tue M"
} ~

Parser/Features         H L F I J
  - ada                 ✓ ✓ ✓ . .
  - agda                ✓ . ✓ . .
  - arduino             ✓ ✓ ✓ ✓ ✓
  - astro               ✓ ✓ ✓ ✓ ✓
  - awk                 ✓ . . . ✓
  - bash                ✓ ✓ ✓ . ✓
  - bass                ✓ ✓ ✓ ✓ ✓
  - beancount           ✓ . ✓ . .
  - bibtex              ✓ . ✓ ✓ .
  - bicep               ✓ ✓ ✓ ✓ ✓
  - blueprint           ✓ . . . .
  - c                   ✓ ✓ ✓ ✓ ✓
  - c_sharp             ✓ ✓ ✓ . ✓
  - cairo               ✓ ✓ ✓ ✓ ✓
  - capnp               ✓ ✓ ✓ ✓ ✓
  - chatito             ✓ ✓ ✓ ✓ ✓
  - clojure             ✓ ✓ ✓ . ✓
  - cmake               ✓ . ✓ ✓ .
  - comment             ✓ . . . .
  - commonlisp          ✓ ✓ ✓ . .
  - cooklang            ✓ . . . .
  - corn                ✓ ✓ ✓ ✓ .
  - cpon                ✓ ✓ ✓ ✓ ✓
  - cpp                 ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - cuda                ✓ ✓ ✓ ✓ ✓
  - cue                 ✓ ✓ ✓ ✓ ✓
  - d                   ✓ . ✓ ✓ ✓
  - dart                ✓ ✓ ✓ ✓ ✓
  - devicetree          ✓ ✓ ✓ ✓ ✓
  - dhall               ✓ . ✓ . ✓
  - diff                ✓ . . . .
  - dockerfile          ✓ . . . ✓
  - dot                 ✓ . . . ✓
  - ebnf                ✓ . . . .
  - eex                 ✓ . . . ✓
  - elixir              ✓ ✓ ✓ ✓ ✓
  - elm                 ✓ . . . ✓
  - elsa                ✓ ✓ ✓ ✓ ✓
  - elvish              ✓ . . . ✓
  - embedded_template   ✓ . . . ✓
  - erlang              ✓ . ✓ . .
  - fennel              ✓ ✓ ✓ . ✓
  - firrtl              ✓ ✓ ✓ ✓ ✓
  - fish                ✓ ✓ ✓ ✓ ✓
  - foam                ✓ ✓ ✓ ✓ ✓
  - fortran             ✓ . ✓ ✓ .
  - fsh                 ✓ . . . .
  - func                ✓ . . . .
  - fusion              ✓ ✓ ✓ ✓ .
  - gdscript            ✓ ✓ ✓ ✓ ✓
  - git_config          ✓ . . . .
  - git_rebase          ✓ . . . ✓
  - gitattributes       ✓ . . . ✓
  - gitcommit           ✓ . . . ✓
  - gitignore           ✓ . . . .
  - gleam               ✓ ✓ ✓ ✓ ✓
  - glimmer             ✓ ✓ ✓ ✓ .
  - glsl                ✓ ✓ ✓ ✓ ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - godot_resource      ✓ ✓ ✓ . .
  - gomod               ✓ . . . ✓
  - gosum               ✓ . . . .
  - gowork              ✓ . . . ✓
  - graphql             ✓ . . ✓ ✓
  - groovy              ✓ . . . ✓
  - hack                ✓ . . . .
  - hare                ✓ ✓ ✓ ✓ ✓
  - haskell             ✓ . ✓ . ✓
  - haskell_persistent  ✓ . ✓ . .
  - hcl                 ✓ . ✓ ✓ ✓
  - heex                ✓ ✓ ✓ ✓ ✓
  - hjson               ✓ ✓ ✓ ✓ ✓
  - hlsl                ✓ ✓ ✓ ✓ ✓
  - hocon               ✓ . . . ✓
  - hoon                ✓ ✓ ✓ . .
  - html                ✓ ✓ ✓ ✓ ✓
  - htmldjango          ✓ . ✓ ✓ ✓
  - http                ✓ . . . ✓
  - ini                 ✓ . ✓ . .
  - ispc                ✓ ✓ ✓ ✓ ✓
  - janet_simple        ✓ ✓ ✓ . ✓
  - java                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - jq                  ✓ . . . ✓
  - jsdoc               ✓ . . . .
  - json                ✓ ✓ ✓ ✓ .
  - json5               ✓ . . . ✓
  - jsonc               ✓ ✓ ✓ ✓ ✓
  - jsonnet             ✓ . . . .
  - julia               ✓ ✓ ✓ ✓ ✓
  - kdl                 ✓ ✓ ✓ ✓ ✓
  - kotlin              ✓ ✓ ✓ . ✓
  - lalrpop             ✓ ✓ . . ✓
  - latex               ✓ . ✓ . ✓
  - ledger              ✓ . ✓ ✓ ✓
  - llvm                ✓ . . . .
  - lua                 ✓ ✓ ✓ ✓ ✓
  - luadoc              ✓ . . . .
  - luap                ✓ . . . .
  - luau                ✓ ✓ ✓ ✓ ✓
  - m68k                ✓ ✓ ✓ . ✓
  - make                ✓ . ✓ . ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - matlab              ✓ ✓ ✓ ✓ ✓
  - menhir              ✓ . . . ✓
  - mermaid             ✓ . . . .
  - meson               ✓ . ✓ . ✓
  - mlir                ✓ ✓ . . .
  - nickel              ✓ . . ✓ .
  - ninja               ✓ . ✓ ✓ .
  - nix                 ✓ ✓ ✓ . ✓
  - norg                . . . . .
  - objc                ✓ ✓ ✓ ✓ ✓
  - ocaml               ✓ ✓ ✓ ✓ ✓
  - ocaml_interface     ✓ ✓ ✓ ✓ ✓
  - ocamllex            ✓ . . . ✓
  - odin                ✓ ✓ ✓ ✓ ✓
  - org                 . . . . .
  - pascal              ✓ ✓ ✓ ✓ ✓
  - passwd              ✓ . . . .
  - pem                 ✓ . ✓ . ✓
  - perl                ✓ . ✓ . ✓
  - php                 ✓ ✓ ✓ ✓ ✓
  - phpdoc              ✓ . . . .
  - pioasm              ✓ . . . ✓
  - po                  ✓ . ✓ . ✓
  - poe_filter          ✓ . ✓ ✓ ✓
  - pony                ✓ ✓ ✓ ✓ ✓
  - prisma              ✓ . . . .
  - proto               ✓ . ✓ . .
  - prql                ✓ . . . ✓
  - pug                 ✓ . . . ✓
  - puppet              ✓ ✓ ✓ ✓ ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - ql                  ✓ ✓ ✓ ✓ ✓
  - qmldir              ✓ . . . ✓
  - qmljs               ✓ . ✓ . .
  - query               ✓ ✓ ✓ ✓ ✓
  - r                   ✓ ✓ . ✓ ✓
  - racket              ✓ . ✓ . ✓
  - rasi                ✓ ✓ ✓ ✓ .
  - regex               ✓ . . . .
  - rego                ✓ . . . ✓
  - rnoweb              ✓ . ✓ . ✓
  - ron                 ✓ ✓ ✓ ✓ ✓
  - rst                 ✓ ✓ . . ✓
  - ruby                ✓ ✓ ✓ ✓ ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - scala               ✓ ✓ ✓ . ✓
  - scheme              ✓ . ✓ . ✓
  - scss                ✓ . ✓ ✓ .
  - slint               ✓ . . ✓ .
  - smali               ✓ ✓ ✓ ✓ ✓
  - smithy              ✓ . . . .
  - solidity            ✓ . . . .
  - sparql              ✓ ✓ ✓ ✓ ✓
  - sql                 ✓ . . ✓ ✓
  - squirrel            ✓ ✓ ✓ ✓ ✓
  - starlark            ✓ ✓ ✓ ✓ ✓
  - supercollider       ✓ ✓ ✓ ✓ ✓
  - surface             ✓ . ✓ ✓ ✓
  - svelte              ✓ . ✓ ✓ ✓
  - swift               ✓ ✓ . ✓ .
  - sxhkdrc             ✓ . ✓ . ✓
  - t32                 ✓ ✓ ✓ ✓ ✓
  - tablegen            ✓ ✓ ✓ ✓ ✓
  - teal                ✓ ✓ ✓ ✓ ✓
  - terraform           ✓ . ✓ ✓ ✓
  - thrift              ✓ ✓ ✓ ✓ ✓
  - tiger               ✓ ✓ ✓ ✓ ✓
  - tlaplus             ✓ ✓ ✓ . ✓
  - todotxt             ✓ . . . .
  - toml                ✓ ✓ ✓ ✓ ✓
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - turtle              ✓ ✓ ✓ ✓ ✓
  - twig                ✓ . . . ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - ungrammar           ✓ ✓ ✓ ✓ ✓
  - usd                 ✓ ✓ ✓ ✓ .
  - uxntal              ✓ ✓ ✓ ✓ ✓
  - v                   ✓ ✓ ✓ ✓ ✓
  - vala                ✓ . ✓ . .
  - verilog             ✓ ✓ ✓ . ✓
  - vhs                 ✓ . . . .
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - vue                 ✓ . ✓ ✓ ✓
  - wgsl                ✓ . ✓ ✓ .
  - wgsl_bevy           ✓ . ✓ ✓ .
  - wing                ✓ ✓ ✓ . .
  - yaml                ✓ ✓ ✓ ✓ ✓
  - yang                ✓ . ✓ ✓ ✓
  - yuck                ✓ ✓ ✓ ✓ ✓
  - zig                 ✓ . ✓ ✓ ✓

  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: require("provider.health").check()

Clipboard (optional) ~
- OK Clipboard tool found: xsel

Python 3 provider (optional) ~
- `g:python3_host_prog` is not set.  Searching for python3 in the environment.
- Executable: /usr/bin/python3
- Python version: 3.10.6
- pynvim version: 0.4.3
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
- Host: /usr/local/bin/neovim-ruby-host
- OK Latest "neovim" gem is installed: 0.9.0

Node.js provider (optional) ~
- Node.js: v20.4.0
- Nvim node.js host: /usr/lib/node_modules/neovim/bin/cli.js
- OK Latest "neovim" npm/yarn/pnpm package is installed: 4.10.1

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.3.1

===== Installed extensions ===== ~

Telescope Extension: `notify` ~
- No healthcheck provided

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /home/mrsandman/.local/state/nvim/lsp.log
- Log size: 10135 KB

vim.lsp: Active Clients ~
- No active clients

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: ada        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ada.so
- OK Parser: agda       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/agda.so
- OK Parser: arduino    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/arduino.so
- OK Parser: astro      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/astro.so
- OK Parser: awk        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/awk.so
- OK Parser: bash       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: bass       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/bass.so
- OK Parser: beancount  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/beancount.so
- OK Parser: bibtex     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/bibtex.so
- OK Parser: bicep      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/bicep.so
- OK Parser: blueprint  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/blueprint.so
- OK Parser: c          ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/c.so
- OK Parser: c_sharp    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/c_sharp.so
- OK Parser: cairo      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cairo.so
- OK Parser: capnp      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/capnp.so
- OK Parser: chatito    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/chatito.so
- OK Parser: clojure    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/clojure.so
- OK Parser: cmake      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cmake.so
- OK Parser: comment    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/comment.so
- OK Parser: commonlisp ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/commonlisp.so
- OK Parser: cooklang   ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cooklang.so
- OK Parser: corn       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/corn.so
- OK Parser: cpon       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cpon.so
- OK Parser: cpp        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cpp.so
- OK Parser: css        ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/css.so
- OK Parser: cuda       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cuda.so
- OK Parser: cue        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/cue.so
- OK Parser: d          ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/d.so
- OK Parser: dart       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/dart.so
- OK Parser: devicetree ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/devicetree.so
- OK Parser: dhall      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/dhall.so
- OK Parser: diff       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/diff.so
- OK Parser: dockerfile ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/dockerfile.so
- OK Parser: dot        ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/dot.so
- OK Parser: ebnf       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ebnf.so
- OK Parser: eex        ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/eex.so
- OK Parser: elixir     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/elixir.so
- OK Parser: elm        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/elm.so
- OK Parser: elsa       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/elsa.so
- OK Parser: elvish     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/elvish.so
- OK Parser: embedded_template ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/embedded_template.so
- OK Parser: erlang     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/erlang.so
- OK Parser: fennel     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/fennel.so
- OK Parser: firrtl     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/firrtl.so
- OK Parser: fish       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/fish.so
- OK Parser: foam       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/foam.so
- OK Parser: fortran    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/fortran.so
- OK Parser: fsh        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/fsh.so
- OK Parser: func       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/func.so
- OK Parser: fusion     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/fusion.so
- OK Parser: gdscript   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gdscript.so
- OK Parser: git_config ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/git_config.so
- OK Parser: git_rebase ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/git_rebase.so
- OK Parser: gitattributes ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gitattributes.so
- OK Parser: gitcommit  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gitcommit.so
- OK Parser: gitignore  ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gitignore.so
- OK Parser: gleam      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gleam.so
- OK Parser: glimmer    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/glimmer.so
- OK Parser: glsl       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/glsl.so
- OK Parser: go         ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/go.so
- OK Parser: godot_resource ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/godot_resource.so
- OK Parser: gomod      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gomod.so
- OK Parser: gosum      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gosum.so
- OK Parser: gowork     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/gowork.so
- OK Parser: graphql    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/graphql.so
- OK Parser: groovy     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/groovy.so
- OK Parser: hack       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hack.so
- OK Parser: hare       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hare.so
- OK Parser: haskell    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/haskell.so
- OK Parser: haskell_persistent ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/haskell_persistent.so
- OK Parser: hcl        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hcl.so
- OK Parser: heex       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/heex.so
- OK Parser: hjson      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hjson.so
- OK Parser: hlsl       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hlsl.so
- OK Parser: hocon      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hocon.so
- OK Parser: hoon       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/hoon.so
- OK Parser: html       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/html.so
- OK Parser: htmldjango ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/htmldjango.so
- OK Parser: http       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/http.so
- OK Parser: ini        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ini.so
- OK Parser: ispc       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ispc.so
- OK Parser: janet_simple ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/janet_simple.so
- OK Parser: java       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/java.so
- OK Parser: javascript ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/javascript.so
- OK Parser: jq         ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/jq.so
- OK Parser: jsdoc      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/jsdoc.so
- OK Parser: json       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/json.so
- OK Parser: json5      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/json5.so
- OK Parser: jsonc      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/jsonc.so
- OK Parser: jsonnet    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/jsonnet.so
- OK Parser: julia      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/julia.so
- OK Parser: kdl        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/kdl.so
- OK Parser: kotlin     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/kotlin.so
- OK Parser: lalrpop    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/lalrpop.so
- OK Parser: latex      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/latex.so
- OK Parser: ledger     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ledger.so
- OK Parser: llvm       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/llvm.so
- OK Parser: lua        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so
- OK Parser: luadoc     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/luadoc.so
- OK Parser: luap       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/luap.so
- OK Parser: luau       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/luau.so
- OK Parser: m68k       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/m68k.so
- OK Parser: make       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/make.so
- OK Parser: markdown   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: matlab     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/matlab.so
- OK Parser: menhir     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/menhir.so
- OK Parser: mermaid    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/mermaid.so
- OK Parser: meson      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/meson.so
- OK Parser: mlir       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/mlir.so
- OK Parser: nickel     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/nickel.so
- OK Parser: ninja      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ninja.so
- OK Parser: nix        ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/nix.so
- OK Parser: norg       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/norg.so
- OK Parser: objc       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/objc.so
- OK Parser: ocaml      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ocaml.so
- OK Parser: ocaml_interface ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ocaml_interface.so
- OK Parser: ocamllex   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ocamllex.so
- OK Parser: odin       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/odin.so
- OK Parser: org        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/org.so
- OK Parser: pascal     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/pascal.so
- OK Parser: passwd     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/passwd.so
- OK Parser: pem        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/pem.so
- OK Parser: perl       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/perl.so
- OK Parser: php        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/php.so
- OK Parser: phpdoc     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/phpdoc.so
- OK Parser: pioasm     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/pioasm.so
- OK Parser: po         ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/po.so
- OK Parser: poe_filter ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/poe_filter.so
- OK Parser: pony       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/pony.so
- OK Parser: prisma     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/prisma.so
- OK Parser: proto      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/proto.so
- OK Parser: prql       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/prql.so
- OK Parser: pug        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/pug.so
- OK Parser: puppet     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/puppet.so
- OK Parser: python     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
- OK Parser: ql         ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ql.so
- OK Parser: qmldir     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/qmldir.so
- OK Parser: qmljs      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/qmljs.so
- OK Parser: query      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/query.so
- OK Parser: r          ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/r.so
- OK Parser: racket     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/racket.so
- OK Parser: rasi       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/rasi.so
- OK Parser: regex      ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/regex.so
- OK Parser: rego       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/rego.so
- OK Parser: rnoweb     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/rnoweb.so
- OK Parser: ron        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ron.so
- OK Parser: rst        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/rst.so
- OK Parser: ruby       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ruby.so
- OK Parser: rust       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/rust.so
- OK Parser: scala      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/scala.so
- OK Parser: scheme     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/scheme.so
- OK Parser: scss       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/scss.so
- OK Parser: slint      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/slint.so
- OK Parser: smali      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/smali.so
- OK Parser: smithy     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/smithy.so
- OK Parser: solidity   ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/solidity.so
- OK Parser: sparql     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/sparql.so
- OK Parser: sql        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/sql.so
- OK Parser: squirrel   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/squirrel.so
- OK Parser: starlark   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/starlark.so
- OK Parser: supercollider ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/supercollider.so
- OK Parser: surface    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/surface.so
- OK Parser: svelte     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/svelte.so
- OK Parser: swift      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/swift.so
- OK Parser: sxhkdrc    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/sxhkdrc.so
- OK Parser: t32        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/t32.so
- OK Parser: tablegen   ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/tablegen.so
- OK Parser: teal       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/teal.so
- OK Parser: terraform  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/terraform.so
- OK Parser: thrift     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/thrift.so
- OK Parser: tiger      ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/tiger.so
- OK Parser: tlaplus    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/tlaplus.so
- OK Parser: todotxt    ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/todotxt.so
- OK Parser: toml       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/toml.so
- OK Parser: tsx        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/tsx.so
- OK Parser: turtle     ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/turtle.so
- OK Parser: twig       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/twig.so
- OK Parser: typescript ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/typescript.so
- OK Parser: ungrammar  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/ungrammar.so
- OK Parser: usd        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/usd.so
- OK Parser: uxntal     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/uxntal.so
- OK Parser: v          ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/v.so
- OK Parser: vala       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/vala.so
- OK Parser: verilog    ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/verilog.so
- OK Parser: vhs        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/vhs.so
- OK Parser: vim        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/vimdoc.so
- OK Parser: vue        ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/vue.so
- OK Parser: wgsl       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/wgsl.so
- OK Parser: wgsl_bevy  ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/wgsl_bevy.so
- OK Parser: wing       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/wing.so
- OK Parser: yaml       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/yaml.so
- OK Parser: yang       ABI: 13, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/yang.so
- OK Parser: yuck       ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/yuck.so
- OK Parser: zig        ABI: 14, path: /home/mrsandman/.local/share/nvim/lazy/nvim-treesitter/parser/zig.so
- OK Parser: bash       ABI: 14, path: /usr/lib/nvim/parser/bash.so
- OK Parser: c          ABI: 14, path: /usr/lib/nvim/parser/c.so
- OK Parser: lua        ABI: 14, path: /usr/lib/nvim/parser/lua.so
- OK Parser: markdown   ABI: 14, path: /usr/lib/nvim/parser/markdown.so
- OK Parser: markdown_inline ABI: 14, path: /usr/lib/nvim/parser/markdown_inline.so
- OK Parser: python     ABI: 14, path: /usr/lib/nvim/parser/python.so
- OK Parser: query      ABI: 14, path: /usr/lib/nvim/parser/query.so
- OK Parser: vim        ABI: 14, path: /usr/lib/nvim/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /usr/lib/nvim/parser/vimdoc.so

==============================================================================
which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: `<Plug>(comment_toggle_linewise)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gb"**
- rhs: `<Plug>(comment_toggle_blockwise)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **" mc"**
- rhs: ` `
- WARNING conflicting keymap exists for mode **"n"**, lhs: **" ca"**
- rhs: `<Cmd>CodeActionMenu<CR>`

Sorry for the long output, could certainly uninstall some parsers.

@virchau13
Copy link
Owner

  1. Just to get the obvious out of the way: If you open a .astro file, is ft set to astro? It should be.

  2. If ft is set correctly, then I'm not sure what's wrong. Try the following minimal reproduction:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end

vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require('lazy').setup({
    {
        "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        lazy = false,
        opts = {
            ensure_installed = {'astro', 'tsx', 'typescript', 'html'},
            auto_install = true,
            highlight = {
                enable = true,
            }
        }
    }
})

Save the above code to /tmp/test.lua, then start Neovim with nvim -u /tmp/test.lua. Run :TSEnable highlight, then open an Astro file with :e. Does it highlight properly? If it does, then there's an error with your configuration.

@mrs4ndman
Copy link
Author

mrs4ndman commented Jul 8, 2023

  1. It is set to astro, I even did the nvim/ftdetect/astro.lua fix that you proposed on the other issues. Just checked it with the lua print(vim.bo.filetype) directly on an open index.astro file.

  2. It does work (not surprising, as the problem was most probably within my config). However, when simplifying my config down and replacing my treesitter config with what you put on the test.lua config, I still have to do :TSEnable highlight to enable the highlighting (which looks great).

Ultimately, the problem is inside my config (I have no clue where) but it is outside the treesitter.lua file, and it only happens with .astro files. Can get by with an autocmd for the treesitter command (EDIT: Just tried the autocmd and it works, will look into my config once again to hunt out the bug)

Thanks for all the help!

@virchau13
Copy link
Owner

virchau13 commented Jul 9, 2023

Wait, I just realised that the example config is actually extremely weird. Why would :TSEnable highlight be required for Astro, but not for HTML? I'll do some more investigation.

@mrs4ndman
Copy link
Author

I am currently trying out this plugin and it does not work unless I specifically execute :TSEnable autotag.

In other LSPs / Treesitter modules, like with .html files it works perfectly, autocompleting and renaming the tag as soon as I get out of Insert mode.

I am also going to investigate around this. Thanks again for all the help :)

@virchau13
Copy link
Owner

virchau13 commented Jul 9, 2023

I figured out the :TSEnable problem: you can't use lazy.nvim's opts for nvim-treesitter, as those settings don't actually get applied (nvim-treesitter doesn't have a .config() function). You have to apply them manually like this:

require('nvim-treesitter.configs').setup({
  -- ...
})

Working minimal example:

local lazypath = vim.env.LAZY or (vim.fn.stdpath("data") .. "/lazy/lazy.nvim")

if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end

vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
  {
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
  }
})

require('nvim-treesitter.configs').setup({
  ensure_installed = {'astro', 'tsx', 'typescript', 'html'},
  auto_install = true,
  highlight = {
    enable = true
  }
})

@mrs4ndman
Copy link
Author

I did try before using the require('nvim-treesitter.configs').setup({}) call to store my options, but it did not work. I just split the config to the nvim/custom/treesitter.lua file I created, put a require for it inside the custom/init.lua and it works!

Sorry for the inconvenience of troubleshooting my own problem. I have seen the opts way of setup for treesitter on many people's configs, so it might be a common issue. Thanks for everything :)

@virchau13
Copy link
Owner

No problem. Seems like lazy.nvim is the new trendy Neovim plugin, so I'll add a disclaimer to the README. Thanks for being the first one to report it, I guess :P

harleylara added a commit to harleylara/dotfiles that referenced this issue Jul 17, 2023
@ishaanparlikar
Copy link

ishaanparlikar commented Jun 10, 2024

Hi @virchau13 @mrs4ndman
Is it working on the latest neovim and treesitter builds? Unfortunatly I was unable to get it to work. I am using Kickstart Neovim

My TS Config

*:TSConfigInfo*

{
  auto_install = true,
  ensure_installed = { "bash", "astro", "c", "html", "lua", "markdown", "vim", "vimdoc" },
  ignore_install = {},
  modules = {
    auto_install = true,
    highlight = {
      additional_vim_regex_highlighting = { "ruby" },
      custom_captures = {},
      disable = {},
      enable = true,
      loaded = true,
      module_path = "nvim-treesitter.highlight"
    },
    incremental_selection = {
      disable = {},
      enable = false,
      keymaps = {
        init_selection = "gnn",
        node_decremental = "grm",
        node_incremental = "grn",
        scope_incremental = "grc"
      },
      module_path = "nvim-treesitter.incremental_selection"
    },
    indent = {
      disable = { "ruby" },
      enable = true,
      loaded = true,
      module_path = "nvim-treesitter.indent"
    }
  },
  sync_install = false
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants