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

Error when trying to install #5

Open
KadoBOT opened this issue Mar 12, 2024 · 11 comments
Open

Error when trying to install #5

KadoBOT opened this issue Mar 12, 2024 · 11 comments

Comments

@KadoBOT
Copy link

KadoBOT commented Mar 12, 2024

I'm getting the following error when installing the pkl grammar.
Here's the error output of the tree-sitter health check:

The following errors have been detected: ~
- ERROR pkl(highlights): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 860 for language pkl
  pkl(highlights) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/highlights.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 860 for language pkl
- ERROR pkl(locals): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1024 for language pkl
  pkl(locals) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/locals.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1024 for language pkl
- ERROR pkl(injections): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 914 for language pkl
  pkl(injections) is concatenated from the following files:
  | [ERROR]:"/Users/kadobot/.local/share/nvim/lazy/pkl-neovim/queries/pkl/injections.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 914 for language pkl


Any ideas?

@holzensp
Copy link
Collaborator

Can you share some versions of things? At least the version of your nvim and the tree sitter package installed for that?

@KadoBOT
Copy link
Author

KadoBOT commented Mar 12, 2024

NVIM v0.9.5
tree-sitter 0.22.1

@holzensp
Copy link
Collaborator

Apologies, I hadn't subscribed to the notifications of this repository. Have things improved, or is this still an issue?

@KadoBOT
Copy link
Author

KadoBOT commented Sep 26, 2024

I cannot tell TBH, I haven't been using this package since then.

@rohan-datar
Copy link

rohan-datar commented Oct 9, 2024

I'm getting similar errors when trying to install this:
from :checkhealth nvim-treesitter

The following errors have been detected: ~
- ERROR pkl(locals): ...-linux64/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 36:3. Impossible pattern:
    (identifier) @local.definition)
    ^
  
  pkl(locals) is concatenated from the following files:
  | [ERROR]:"/home/rdatar/.local/share/nvim/lazy/pkl-neovim/queries/pkl/locals.scm", failed to load: ...-linux64/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 36:3. Impossible pattern:
    (identifier) @local.definition)

@bioball
Copy link
Contributor

bioball commented Oct 9, 2024

Are you using tree-sitter-pkl directly?

The queries in pkl-neovim are tied to a specific version of tree-sitter-pkl. There have been some breaking changes in the grammar recently, so, the queries in pkl-neovim aren't expected to work with the main branch in this repo.

@rohan-datar
Copy link

That's good to know. I tried to install the parser from this repo directly because I was having some issues with the official plugin not loading properly. Is there a branch that is known to be stable?

@bioball
Copy link
Contributor

bioball commented Oct 9, 2024

pkl-neovim currently pins to commit b79c8c4d2419e82324d9aca31e9de47ed8304f1f of tree-sitter-pkl. Try using that commit to see if that helps.

@rohan-datar
Copy link

Switched to that branch and I'm still getting the exact same error in :checkhealth, but syntax highlighting works now? Interestingly, I also tried switching back to the pkl-neovim and it had the same effect, treesitter throws an error but syntax highlighting seems to work

When opening a .pkl file:
image
Inside the file:
image

@bioball
Copy link
Contributor

bioball commented Oct 9, 2024

Hm, that's odd.

Those queries are from https://github.com/apple/pkl-neovim/blob/release/0.6/queries/pkl/locals.scm

You can try commenting out those lines to see if that helps you.

@rohan-datar
Copy link

Commenting out those lines worked! It seems to be these in particular that are the problem.

(objectMethod
  (identifier) @local.definition)
  
(classProperty
  (methodHeader (identifier)) @local.definition)

(objectProperty
  (methodHeader (identifier)) @local.definition)

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

4 participants