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

Angular (tree-sitter-angular) parser cannot be installed #6303

Closed
Franiac opened this issue Mar 15, 2024 · 1 comment
Closed

Angular (tree-sitter-angular) parser cannot be installed #6303

Franiac opened this issue Mar 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Franiac
Copy link

Franiac commented Mar 15, 2024

Describe the bug

:TSInstall angular results in the following error on tree-sitter generate:

nvim-treesitter[angular]: Error during "tree-sitter generate"
Replacing nan dependency with node-addon-api in package.json
Adding node-gyp-build dependency to package.json
Adding prebuildify devDependency to package.json
Adding an install script to package.json
Adding a prebuildify script to package.json
Adding peerDependencies to package.json
Adding types to package.json
Adding files to package.json
Failed to locate a package.json file that has a "tree-sitter" section, please ensure you have one, and if you don't then consult the docs

This happens because tree-sitter generate expects package.json to have the "tree-sitter" section.

This is also mentioned here: tree-sitter/tree-sitter#3170

If I add

"tree-sitter": [
  {
    "file-types": [
      "angular"
    ]
  }
]

and run tree-sitter generate manually, it works, but :TSInstall angular overwrites package.json on every call.

To Reproduce

Just run :TSInstall angular -> Error

Expected behavior

:TSInstall angular should not fail on tree-sitter generate

Output of :checkhealth nvim-treesitter

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

Installation ~
- OK `tree-sitter` found 0.22.1 (1c38d34deac5ae7ea797a559f596fb4ec9008eb4) (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v20.11.1 (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.4.0-1ubuntu1~22.04) 11.4.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 = "5.15.146.1-microsoft-standard-WSL2",
  sysname = "Linux",
  version = "#1 SMP Thu Jan 11 04:09:03 UTC 2024"
} ~

Parser/Features         H L F I J
  - c                   ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - json                ✓ ✓ ✓ ✓ .
  - lua                 ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - scss                ✓ . ✓ ✓ .
  - typescript          ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓

  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.9.5
Build type: Release
LuaJIT 2.1.1692716794

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Additional context

I am running Ubuntu 22.04 inside WSL2 on Windows 11

@Franiac Franiac added the bug Something isn't working label Mar 15, 2024
@clason
Copy link
Contributor

clason commented Mar 16, 2024

Please report at the parser repo; nothing we can do.

@clason clason closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants