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

neovimUtils: also move queries #321550

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

MangoIV
Copy link
Contributor

@MangoIV MangoIV commented Jun 21, 2024

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@MangoIV MangoIV force-pushed the mangoiv/fix-tree-sitter-to-plugin branch from 419e1dc to f78d01f Compare June 21, 2024 15:38
@MangoIV MangoIV changed the title nvimUtils: also move queries neovimUtils: also move queries Jun 21, 2024
@MangoIV
Copy link
Contributor Author

MangoIV commented Jun 21, 2024

image

finally, stuff works!

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 23, 2024
@teto
Copy link
Member

teto commented Jun 24, 2024

It's odd you are the first one to hit this issue xD
Do you have an example of a grammar that is fixed by this, that I could test on ? eventually we should also install the rest of vim folders/ so maybe we should instead copy everything to $out.

@Gerg-L
Copy link
Contributor

Gerg-L commented Jun 24, 2024

Result of nixpkgs-review pr 321550 run on x86_64-linux 1

281 packages built:
  • vimPlugins.image-nvim
  • vimPlugins.nvim-treesitter-parsers.ada
  • vimPlugins.nvim-treesitter-parsers.agda
  • vimPlugins.nvim-treesitter-parsers.angular
  • vimPlugins.nvim-treesitter-parsers.apex
  • vimPlugins.nvim-treesitter-parsers.arduino
  • vimPlugins.nvim-treesitter-parsers.asm
  • vimPlugins.nvim-treesitter-parsers.astro
  • vimPlugins.nvim-treesitter-parsers.authzed
  • vimPlugins.nvim-treesitter-parsers.awk
  • vimPlugins.nvim-treesitter-parsers.bash
  • vimPlugins.nvim-treesitter-parsers.bass
  • vimPlugins.nvim-treesitter-parsers.beancount
  • vimPlugins.nvim-treesitter-parsers.bibtex
  • vimPlugins.nvim-treesitter-parsers.bicep
  • vimPlugins.nvim-treesitter-parsers.bitbake
  • vimPlugins.nvim-treesitter-parsers.blueprint
  • vimPlugins.nvim-treesitter-parsers.bp
  • vimPlugins.nvim-treesitter-parsers.c
  • vimPlugins.nvim-treesitter-parsers.c_sharp
  • vimPlugins.nvim-treesitter-parsers.cairo
  • vimPlugins.nvim-treesitter-parsers.capnp
  • vimPlugins.nvim-treesitter-parsers.chatito
  • vimPlugins.nvim-treesitter-parsers.clojure
  • vimPlugins.nvim-treesitter-parsers.cmake
  • vimPlugins.nvim-treesitter-parsers.comment
  • vimPlugins.nvim-treesitter-parsers.commonlisp
  • vimPlugins.nvim-treesitter-parsers.cooklang
  • vimPlugins.nvim-treesitter-parsers.corn
  • vimPlugins.nvim-treesitter-parsers.cpon
  • vimPlugins.nvim-treesitter-parsers.cpp
  • vimPlugins.nvim-treesitter-parsers.css
  • vimPlugins.nvim-treesitter-parsers.csv
  • vimPlugins.nvim-treesitter-parsers.cuda
  • vimPlugins.nvim-treesitter-parsers.cue
  • vimPlugins.nvim-treesitter-parsers.d
  • vimPlugins.nvim-treesitter-parsers.dart
  • vimPlugins.nvim-treesitter-parsers.devicetree
  • vimPlugins.nvim-treesitter-parsers.dhall
  • vimPlugins.nvim-treesitter-parsers.diff
  • vimPlugins.nvim-treesitter-parsers.disassembly
  • vimPlugins.nvim-treesitter-parsers.djot
  • vimPlugins.nvim-treesitter-parsers.dockerfile
  • vimPlugins.nvim-treesitter-parsers.dot
  • vimPlugins.nvim-treesitter-parsers.doxygen
  • vimPlugins.nvim-treesitter-parsers.dtd
  • vimPlugins.nvim-treesitter-parsers.earthfile
  • vimPlugins.nvim-treesitter-parsers.ebnf
  • vimPlugins.nvim-treesitter-parsers.eds
  • vimPlugins.nvim-treesitter-parsers.eex
  • vimPlugins.nvim-treesitter-parsers.elixir
  • vimPlugins.nvim-treesitter-parsers.elm
  • vimPlugins.nvim-treesitter-parsers.elsa
  • vimPlugins.nvim-treesitter-parsers.elvish
  • vimPlugins.nvim-treesitter-parsers.embedded_template
  • vimPlugins.nvim-treesitter-parsers.erlang
  • vimPlugins.nvim-treesitter-parsers.facility
  • vimPlugins.nvim-treesitter-parsers.faust
  • vimPlugins.nvim-treesitter-parsers.fennel
  • vimPlugins.nvim-treesitter-parsers.fidl
  • vimPlugins.nvim-treesitter-parsers.firrtl
  • vimPlugins.nvim-treesitter-parsers.fish
  • vimPlugins.nvim-treesitter-parsers.foam
  • vimPlugins.nvim-treesitter-parsers.forth
  • vimPlugins.nvim-treesitter-parsers.fortran
  • vimPlugins.nvim-treesitter-parsers.fsh
  • vimPlugins.nvim-treesitter-parsers.func
  • vimPlugins.nvim-treesitter-parsers.fusion
  • vimPlugins.nvim-treesitter-parsers.gdscript
  • vimPlugins.nvim-treesitter-parsers.gdshader
  • vimPlugins.nvim-treesitter-parsers.git_config
  • vimPlugins.nvim-treesitter-parsers.git_rebase
  • vimPlugins.nvim-treesitter-parsers.gitattributes
  • vimPlugins.nvim-treesitter-parsers.gitcommit
  • vimPlugins.nvim-treesitter-parsers.gitignore
  • vimPlugins.nvim-treesitter-parsers.gleam
  • vimPlugins.nvim-treesitter-parsers.glimmer
  • vimPlugins.nvim-treesitter-parsers.glsl
  • vimPlugins.nvim-treesitter-parsers.gn
  • vimPlugins.nvim-treesitter-parsers.gnuplot
  • vimPlugins.nvim-treesitter-parsers.go
  • vimPlugins.nvim-treesitter-parsers.godot_resource
  • vimPlugins.nvim-treesitter-parsers.gomod
  • vimPlugins.nvim-treesitter-parsers.gosum
  • vimPlugins.nvim-treesitter-parsers.gotmpl
  • vimPlugins.nvim-treesitter-parsers.gowork
  • vimPlugins.nvim-treesitter-parsers.gpg
  • vimPlugins.nvim-treesitter-parsers.graphql
  • vimPlugins.nvim-treesitter-parsers.groovy
  • vimPlugins.nvim-treesitter-parsers.gstlaunch
  • vimPlugins.nvim-treesitter-parsers.hack
  • vimPlugins.nvim-treesitter-parsers.hare
  • vimPlugins.nvim-treesitter-parsers.haskell
  • vimPlugins.nvim-treesitter-parsers.haskell_persistent
  • vimPlugins.nvim-treesitter-parsers.hcl
  • vimPlugins.nvim-treesitter-parsers.heex
  • vimPlugins.nvim-treesitter-parsers.helm
  • vimPlugins.nvim-treesitter-parsers.hjson
  • vimPlugins.nvim-treesitter-parsers.hlsl
  • vimPlugins.nvim-treesitter-parsers.hlsplaylist
  • vimPlugins.nvim-treesitter-parsers.hocon
  • vimPlugins.nvim-treesitter-parsers.hoon
  • vimPlugins.nvim-treesitter-parsers.html
  • vimPlugins.nvim-treesitter-parsers.htmldjango
  • vimPlugins.nvim-treesitter-parsers.http
  • vimPlugins.nvim-treesitter-parsers.hurl
  • vimPlugins.nvim-treesitter-parsers.hyprlang
  • vimPlugins.nvim-treesitter-parsers.idl
  • vimPlugins.nvim-treesitter-parsers.ini
  • vimPlugins.nvim-treesitter-parsers.inko
  • vimPlugins.nvim-treesitter-parsers.ispc
  • vimPlugins.nvim-treesitter-parsers.janet_simple
  • vimPlugins.nvim-treesitter-parsers.java
  • vimPlugins.nvim-treesitter-parsers.javascript
  • vimPlugins.nvim-treesitter-parsers.jq
  • vimPlugins.nvim-treesitter-parsers.jsdoc
  • vimPlugins.nvim-treesitter-parsers.json
  • vimPlugins.nvim-treesitter-parsers.json5
  • vimPlugins.nvim-treesitter-parsers.jsonc
  • vimPlugins.nvim-treesitter-parsers.jsonnet
  • vimPlugins.nvim-treesitter-parsers.julia
  • vimPlugins.nvim-treesitter-parsers.just
  • vimPlugins.nvim-treesitter-parsers.kconfig
  • vimPlugins.nvim-treesitter-parsers.kdl
  • vimPlugins.nvim-treesitter-parsers.kotlin
  • vimPlugins.nvim-treesitter-parsers.koto
  • vimPlugins.nvim-treesitter-parsers.kusto
  • vimPlugins.nvim-treesitter-parsers.lalrpop
  • vimPlugins.nvim-treesitter-parsers.latex
  • vimPlugins.nvim-treesitter-parsers.ledger
  • vimPlugins.nvim-treesitter-parsers.leo
  • vimPlugins.nvim-treesitter-parsers.linkerscript
  • vimPlugins.nvim-treesitter-parsers.liquid
  • vimPlugins.nvim-treesitter-parsers.liquidsoap
  • vimPlugins.nvim-treesitter-parsers.llvm
  • vimPlugins.nvim-treesitter-parsers.lua
  • vimPlugins.nvim-treesitter-parsers.luadoc
  • vimPlugins.nvim-treesitter-parsers.luap
  • vimPlugins.nvim-treesitter-parsers.luau
  • vimPlugins.nvim-treesitter-parsers.m68k
  • vimPlugins.nvim-treesitter-parsers.make
  • vimPlugins.nvim-treesitter-parsers.markdown
  • vimPlugins.nvim-treesitter-parsers.markdown_inline
  • vimPlugins.nvim-treesitter-parsers.matlab
  • vimPlugins.nvim-treesitter-parsers.menhir
  • vimPlugins.nvim-treesitter-parsers.mermaid
  • vimPlugins.nvim-treesitter-parsers.meson
  • vimPlugins.nvim-treesitter-parsers.mlir
  • vimPlugins.nvim-treesitter-parsers.muttrc
  • vimPlugins.nvim-treesitter-parsers.nasm
  • vimPlugins.nvim-treesitter-parsers.nickel
  • vimPlugins.nvim-treesitter-parsers.nim
  • vimPlugins.nvim-treesitter-parsers.nim_format_string
  • vimPlugins.nvim-treesitter-parsers.ninja
  • vimPlugins.nvim-treesitter-parsers.nix
  • vimPlugins.nvim-treesitter-parsers.norg
  • vimPlugins.nvim-treesitter-parsers.nqc
  • vimPlugins.nvim-treesitter-parsers.objc
  • vimPlugins.nvim-treesitter-parsers.objdump
  • vimPlugins.nvim-treesitter-parsers.ocaml
  • vimPlugins.nvim-treesitter-parsers.ocaml_interface
  • vimPlugins.nvim-treesitter-parsers.ocamllex
  • vimPlugins.nvim-treesitter-parsers.odin
  • vimPlugins.nvim-treesitter-parsers.org
  • vimPlugins.nvim-treesitter-parsers.pascal
  • vimPlugins.nvim-treesitter-parsers.passwd
  • vimPlugins.nvim-treesitter-parsers.pem
  • vimPlugins.nvim-treesitter-parsers.perl
  • vimPlugins.nvim-treesitter-parsers.php
  • vimPlugins.nvim-treesitter-parsers.php_only
  • vimPlugins.nvim-treesitter-parsers.phpdoc
  • vimPlugins.nvim-treesitter-parsers.pioasm
  • vimPlugins.nvim-treesitter-parsers.po
  • vimPlugins.nvim-treesitter-parsers.pod
  • vimPlugins.nvim-treesitter-parsers.poe_filter
  • vimPlugins.nvim-treesitter-parsers.pony
  • vimPlugins.nvim-treesitter-parsers.printf
  • vimPlugins.nvim-treesitter-parsers.prisma
  • vimPlugins.nvim-treesitter-parsers.promql
  • vimPlugins.nvim-treesitter-parsers.properties
  • vimPlugins.nvim-treesitter-parsers.proto
  • vimPlugins.nvim-treesitter-parsers.prql
  • vimPlugins.nvim-treesitter-parsers.psv
  • vimPlugins.nvim-treesitter-parsers.pug
  • vimPlugins.nvim-treesitter-parsers.puppet
  • vimPlugins.nvim-treesitter-parsers.purescript
  • vimPlugins.nvim-treesitter-parsers.pymanifest
  • vimPlugins.nvim-treesitter-parsers.python
  • vimPlugins.nvim-treesitter-parsers.ql
  • vimPlugins.nvim-treesitter-parsers.qmldir
  • vimPlugins.nvim-treesitter-parsers.qmljs
  • vimPlugins.nvim-treesitter-parsers.query
  • vimPlugins.nvim-treesitter-parsers.r
  • vimPlugins.nvim-treesitter-parsers.racket
  • vimPlugins.nvim-treesitter-parsers.ralph
  • vimPlugins.nvim-treesitter-parsers.rasi
  • vimPlugins.nvim-treesitter-parsers.rbs
  • vimPlugins.nvim-treesitter-parsers.re2c
  • vimPlugins.nvim-treesitter-parsers.readline
  • vimPlugins.nvim-treesitter-parsers.regex
  • vimPlugins.nvim-treesitter-parsers.rego
  • vimPlugins.nvim-treesitter-parsers.requirements
  • vimPlugins.nvim-treesitter-parsers.rnoweb
  • vimPlugins.nvim-treesitter-parsers.robot
  • vimPlugins.nvim-treesitter-parsers.roc
  • vimPlugins.nvim-treesitter-parsers.ron
  • vimPlugins.nvim-treesitter-parsers.rst
  • vimPlugins.nvim-treesitter-parsers.ruby
  • vimPlugins.nvim-treesitter-parsers.rust
  • vimPlugins.nvim-treesitter-parsers.scala
  • vimPlugins.nvim-treesitter-parsers.scfg
  • vimPlugins.nvim-treesitter-parsers.scheme
  • vimPlugins.nvim-treesitter-parsers.scss
  • vimPlugins.nvim-treesitter-parsers.slang
  • vimPlugins.nvim-treesitter-parsers.slint
  • vimPlugins.nvim-treesitter-parsers.smali
  • vimPlugins.nvim-treesitter-parsers.smithy
  • vimPlugins.nvim-treesitter-parsers.snakemake
  • vimPlugins.nvim-treesitter-parsers.solidity
  • vimPlugins.nvim-treesitter-parsers.soql
  • vimPlugins.nvim-treesitter-parsers.sosl
  • vimPlugins.nvim-treesitter-parsers.sourcepawn
  • vimPlugins.nvim-treesitter-parsers.sparql
  • vimPlugins.nvim-treesitter-parsers.sql
  • vimPlugins.nvim-treesitter-parsers.squirrel
  • vimPlugins.nvim-treesitter-parsers.ssh_config
  • vimPlugins.nvim-treesitter-parsers.starlark
  • vimPlugins.nvim-treesitter-parsers.strace
  • vimPlugins.nvim-treesitter-parsers.styled
  • vimPlugins.nvim-treesitter-parsers.supercollider
  • vimPlugins.nvim-treesitter-parsers.surface
  • vimPlugins.nvim-treesitter-parsers.svelte
  • vimPlugins.nvim-treesitter-parsers.swift
  • vimPlugins.nvim-treesitter-parsers.sxhkdrc
  • vimPlugins.nvim-treesitter-parsers.systemtap
  • vimPlugins.nvim-treesitter-parsers.t32
  • vimPlugins.nvim-treesitter-parsers.tablegen
  • vimPlugins.nvim-treesitter-parsers.tact
  • vimPlugins.nvim-treesitter-parsers.tcl
  • vimPlugins.nvim-treesitter-parsers.teal
  • vimPlugins.nvim-treesitter-parsers.templ
  • vimPlugins.nvim-treesitter-parsers.terraform
  • vimPlugins.nvim-treesitter-parsers.textproto
  • vimPlugins.nvim-treesitter-parsers.thrift
  • vimPlugins.nvim-treesitter-parsers.tiger
  • vimPlugins.nvim-treesitter-parsers.tlaplus
  • vimPlugins.nvim-treesitter-parsers.tmux
  • vimPlugins.nvim-treesitter-parsers.todotxt
  • vimPlugins.nvim-treesitter-parsers.toml
  • vimPlugins.nvim-treesitter-parsers.tsv
  • vimPlugins.nvim-treesitter-parsers.tsx
  • vimPlugins.nvim-treesitter-parsers.turtle
  • vimPlugins.nvim-treesitter-parsers.twig
  • vimPlugins.nvim-treesitter-parsers.typescript
  • vimPlugins.nvim-treesitter-parsers.typespec
  • vimPlugins.nvim-treesitter-parsers.typoscript
  • vimPlugins.nvim-treesitter-parsers.typst
  • vimPlugins.nvim-treesitter-parsers.udev
  • vimPlugins.nvim-treesitter-parsers.ungrammar
  • vimPlugins.nvim-treesitter-parsers.unison
  • vimPlugins.nvim-treesitter-parsers.usd
  • vimPlugins.nvim-treesitter-parsers.uxntal
  • vimPlugins.nvim-treesitter-parsers.v
  • vimPlugins.nvim-treesitter-parsers.vala
  • vimPlugins.nvim-treesitter-parsers.vento
  • vimPlugins.nvim-treesitter-parsers.verilog
  • vimPlugins.nvim-treesitter-parsers.vhs
  • vimPlugins.nvim-treesitter-parsers.vim
  • vimPlugins.nvim-treesitter-parsers.vimdoc
  • vimPlugins.nvim-treesitter-parsers.vue
  • vimPlugins.nvim-treesitter-parsers.wgsl
  • vimPlugins.nvim-treesitter-parsers.wgsl_bevy
  • vimPlugins.nvim-treesitter-parsers.wing
  • vimPlugins.nvim-treesitter-parsers.wit
  • vimPlugins.nvim-treesitter-parsers.xcompose
  • vimPlugins.nvim-treesitter-parsers.xml
  • vimPlugins.nvim-treesitter-parsers.yaml
  • vimPlugins.nvim-treesitter-parsers.yang
  • vimPlugins.nvim-treesitter-parsers.yuck
  • vimPlugins.nvim-treesitter-parsers.zathurarc
  • vimPlugins.nvim-treesitter-parsers.zig

@MangoIV
Copy link
Contributor Author

MangoIV commented Jun 24, 2024

@teto yes, the koka grammar. by accident I have prepared this:
koka-lang/koka#559

fun main()
  // prints hello world
  println("Hello world!")

and here's an example you can put into a file hello.kk

@teto
Copy link
Member

teto commented Jun 24, 2024

the koka grammar puts its queries directly in "queries" folder https://github.com/mtoohey31/tree-sitter-koka/tree/main/queries
but some others puts it in a folder expected by neovim like https://github.com/tjdevries/tree-sitter-lua/tree/master/queries/lua .

I think your approach is the correct one since that's how official treesitter grammars are packaged.

Could you check if tjdevries is the odd one ?
for instance fail if [ -d queries/{name} ] exists and the number of failed builds will show us the number of grammars conceived only for neovim and if it's a big enough number we might want to address it.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jun 24, 2024

We can also just check if they’re already present and if they are, just don’t move something there, assuming that the author knew what they were doing.

I.e. We don’t have to fail when they already exist.

@teto
Copy link
Member

teto commented Jun 24, 2024

We can also just check if they’re already present and if they are, just don’t move something there, assuming that the author knew what they were doing.

Agreed

@teto
Copy link
Member

teto commented Jun 24, 2024

what would be nice is to have some debugging output that explains what's going on:

  • "queries already in place for neovim"
  • "moving queries where expected by neovim"
  • "No queries"

@wegank wegank added 12.approvals: 2 This PR was reviewed and approved by two reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Jun 24, 2024
@MangoIV MangoIV force-pushed the mangoiv/fix-tree-sitter-to-plugin branch from f78d01f to d5122fd Compare June 29, 2024 19:41
@MangoIV MangoIV force-pushed the mangoiv/fix-tree-sitter-to-plugin branch from d5122fd to 6a386d7 Compare June 29, 2024 19:42
@MangoIV MangoIV requested review from Gerg-L and itslychee June 29, 2024 19:43
@MangoIV
Copy link
Contributor Author

MangoIV commented Jun 29, 2024

I have done some adjustments such that we can also move if the grammar author has already prepared for vim and to tell the user if moving the grammar failed

@Gerg-L
Copy link
Contributor

Gerg-L commented Jun 29, 2024

Result of nixpkgs-review pr 321550 run on x86_64-linux 1

281 packages built:
  • vimPlugins.image-nvim
  • vimPlugins.nvim-treesitter-parsers.ada
  • vimPlugins.nvim-treesitter-parsers.agda
  • vimPlugins.nvim-treesitter-parsers.angular
  • vimPlugins.nvim-treesitter-parsers.apex
  • vimPlugins.nvim-treesitter-parsers.arduino
  • vimPlugins.nvim-treesitter-parsers.asm
  • vimPlugins.nvim-treesitter-parsers.astro
  • vimPlugins.nvim-treesitter-parsers.authzed
  • vimPlugins.nvim-treesitter-parsers.awk
  • vimPlugins.nvim-treesitter-parsers.bash
  • vimPlugins.nvim-treesitter-parsers.bass
  • vimPlugins.nvim-treesitter-parsers.beancount
  • vimPlugins.nvim-treesitter-parsers.bibtex
  • vimPlugins.nvim-treesitter-parsers.bicep
  • vimPlugins.nvim-treesitter-parsers.bitbake
  • vimPlugins.nvim-treesitter-parsers.blueprint
  • vimPlugins.nvim-treesitter-parsers.bp
  • vimPlugins.nvim-treesitter-parsers.c
  • vimPlugins.nvim-treesitter-parsers.c_sharp
  • vimPlugins.nvim-treesitter-parsers.cairo
  • vimPlugins.nvim-treesitter-parsers.capnp
  • vimPlugins.nvim-treesitter-parsers.chatito
  • vimPlugins.nvim-treesitter-parsers.clojure
  • vimPlugins.nvim-treesitter-parsers.cmake
  • vimPlugins.nvim-treesitter-parsers.comment
  • vimPlugins.nvim-treesitter-parsers.commonlisp
  • vimPlugins.nvim-treesitter-parsers.cooklang
  • vimPlugins.nvim-treesitter-parsers.corn
  • vimPlugins.nvim-treesitter-parsers.cpon
  • vimPlugins.nvim-treesitter-parsers.cpp
  • vimPlugins.nvim-treesitter-parsers.css
  • vimPlugins.nvim-treesitter-parsers.csv
  • vimPlugins.nvim-treesitter-parsers.cuda
  • vimPlugins.nvim-treesitter-parsers.cue
  • vimPlugins.nvim-treesitter-parsers.d
  • vimPlugins.nvim-treesitter-parsers.dart
  • vimPlugins.nvim-treesitter-parsers.devicetree
  • vimPlugins.nvim-treesitter-parsers.dhall
  • vimPlugins.nvim-treesitter-parsers.diff
  • vimPlugins.nvim-treesitter-parsers.disassembly
  • vimPlugins.nvim-treesitter-parsers.djot
  • vimPlugins.nvim-treesitter-parsers.dockerfile
  • vimPlugins.nvim-treesitter-parsers.dot
  • vimPlugins.nvim-treesitter-parsers.doxygen
  • vimPlugins.nvim-treesitter-parsers.dtd
  • vimPlugins.nvim-treesitter-parsers.earthfile
  • vimPlugins.nvim-treesitter-parsers.ebnf
  • vimPlugins.nvim-treesitter-parsers.eds
  • vimPlugins.nvim-treesitter-parsers.eex
  • vimPlugins.nvim-treesitter-parsers.elixir
  • vimPlugins.nvim-treesitter-parsers.elm
  • vimPlugins.nvim-treesitter-parsers.elsa
  • vimPlugins.nvim-treesitter-parsers.elvish
  • vimPlugins.nvim-treesitter-parsers.embedded_template
  • vimPlugins.nvim-treesitter-parsers.erlang
  • vimPlugins.nvim-treesitter-parsers.facility
  • vimPlugins.nvim-treesitter-parsers.faust
  • vimPlugins.nvim-treesitter-parsers.fennel
  • vimPlugins.nvim-treesitter-parsers.fidl
  • vimPlugins.nvim-treesitter-parsers.firrtl
  • vimPlugins.nvim-treesitter-parsers.fish
  • vimPlugins.nvim-treesitter-parsers.foam
  • vimPlugins.nvim-treesitter-parsers.forth
  • vimPlugins.nvim-treesitter-parsers.fortran
  • vimPlugins.nvim-treesitter-parsers.fsh
  • vimPlugins.nvim-treesitter-parsers.func
  • vimPlugins.nvim-treesitter-parsers.fusion
  • vimPlugins.nvim-treesitter-parsers.gdscript
  • vimPlugins.nvim-treesitter-parsers.gdshader
  • vimPlugins.nvim-treesitter-parsers.git_config
  • vimPlugins.nvim-treesitter-parsers.git_rebase
  • vimPlugins.nvim-treesitter-parsers.gitattributes
  • vimPlugins.nvim-treesitter-parsers.gitcommit
  • vimPlugins.nvim-treesitter-parsers.gitignore
  • vimPlugins.nvim-treesitter-parsers.gleam
  • vimPlugins.nvim-treesitter-parsers.glimmer
  • vimPlugins.nvim-treesitter-parsers.glsl
  • vimPlugins.nvim-treesitter-parsers.gn
  • vimPlugins.nvim-treesitter-parsers.gnuplot
  • vimPlugins.nvim-treesitter-parsers.go
  • vimPlugins.nvim-treesitter-parsers.godot_resource
  • vimPlugins.nvim-treesitter-parsers.gomod
  • vimPlugins.nvim-treesitter-parsers.gosum
  • vimPlugins.nvim-treesitter-parsers.gotmpl
  • vimPlugins.nvim-treesitter-parsers.gowork
  • vimPlugins.nvim-treesitter-parsers.gpg
  • vimPlugins.nvim-treesitter-parsers.graphql
  • vimPlugins.nvim-treesitter-parsers.groovy
  • vimPlugins.nvim-treesitter-parsers.gstlaunch
  • vimPlugins.nvim-treesitter-parsers.hack
  • vimPlugins.nvim-treesitter-parsers.hare
  • vimPlugins.nvim-treesitter-parsers.haskell
  • vimPlugins.nvim-treesitter-parsers.haskell_persistent
  • vimPlugins.nvim-treesitter-parsers.hcl
  • vimPlugins.nvim-treesitter-parsers.heex
  • vimPlugins.nvim-treesitter-parsers.helm
  • vimPlugins.nvim-treesitter-parsers.hjson
  • vimPlugins.nvim-treesitter-parsers.hlsl
  • vimPlugins.nvim-treesitter-parsers.hlsplaylist
  • vimPlugins.nvim-treesitter-parsers.hocon
  • vimPlugins.nvim-treesitter-parsers.hoon
  • vimPlugins.nvim-treesitter-parsers.html
  • vimPlugins.nvim-treesitter-parsers.htmldjango
  • vimPlugins.nvim-treesitter-parsers.http
  • vimPlugins.nvim-treesitter-parsers.hurl
  • vimPlugins.nvim-treesitter-parsers.hyprlang
  • vimPlugins.nvim-treesitter-parsers.idl
  • vimPlugins.nvim-treesitter-parsers.ini
  • vimPlugins.nvim-treesitter-parsers.inko
  • vimPlugins.nvim-treesitter-parsers.ispc
  • vimPlugins.nvim-treesitter-parsers.janet_simple
  • vimPlugins.nvim-treesitter-parsers.java
  • vimPlugins.nvim-treesitter-parsers.javascript
  • vimPlugins.nvim-treesitter-parsers.jq
  • vimPlugins.nvim-treesitter-parsers.jsdoc
  • vimPlugins.nvim-treesitter-parsers.json
  • vimPlugins.nvim-treesitter-parsers.json5
  • vimPlugins.nvim-treesitter-parsers.jsonc
  • vimPlugins.nvim-treesitter-parsers.jsonnet
  • vimPlugins.nvim-treesitter-parsers.julia
  • vimPlugins.nvim-treesitter-parsers.just
  • vimPlugins.nvim-treesitter-parsers.kconfig
  • vimPlugins.nvim-treesitter-parsers.kdl
  • vimPlugins.nvim-treesitter-parsers.kotlin
  • vimPlugins.nvim-treesitter-parsers.koto
  • vimPlugins.nvim-treesitter-parsers.kusto
  • vimPlugins.nvim-treesitter-parsers.lalrpop
  • vimPlugins.nvim-treesitter-parsers.latex
  • vimPlugins.nvim-treesitter-parsers.ledger
  • vimPlugins.nvim-treesitter-parsers.leo
  • vimPlugins.nvim-treesitter-parsers.linkerscript
  • vimPlugins.nvim-treesitter-parsers.liquid
  • vimPlugins.nvim-treesitter-parsers.liquidsoap
  • vimPlugins.nvim-treesitter-parsers.llvm
  • vimPlugins.nvim-treesitter-parsers.lua
  • vimPlugins.nvim-treesitter-parsers.luadoc
  • vimPlugins.nvim-treesitter-parsers.luap
  • vimPlugins.nvim-treesitter-parsers.luau
  • vimPlugins.nvim-treesitter-parsers.m68k
  • vimPlugins.nvim-treesitter-parsers.make
  • vimPlugins.nvim-treesitter-parsers.markdown
  • vimPlugins.nvim-treesitter-parsers.markdown_inline
  • vimPlugins.nvim-treesitter-parsers.matlab
  • vimPlugins.nvim-treesitter-parsers.menhir
  • vimPlugins.nvim-treesitter-parsers.mermaid
  • vimPlugins.nvim-treesitter-parsers.meson
  • vimPlugins.nvim-treesitter-parsers.mlir
  • vimPlugins.nvim-treesitter-parsers.muttrc
  • vimPlugins.nvim-treesitter-parsers.nasm
  • vimPlugins.nvim-treesitter-parsers.nickel
  • vimPlugins.nvim-treesitter-parsers.nim
  • vimPlugins.nvim-treesitter-parsers.nim_format_string
  • vimPlugins.nvim-treesitter-parsers.ninja
  • vimPlugins.nvim-treesitter-parsers.nix
  • vimPlugins.nvim-treesitter-parsers.norg
  • vimPlugins.nvim-treesitter-parsers.nqc
  • vimPlugins.nvim-treesitter-parsers.objc
  • vimPlugins.nvim-treesitter-parsers.objdump
  • vimPlugins.nvim-treesitter-parsers.ocaml
  • vimPlugins.nvim-treesitter-parsers.ocaml_interface
  • vimPlugins.nvim-treesitter-parsers.ocamllex
  • vimPlugins.nvim-treesitter-parsers.odin
  • vimPlugins.nvim-treesitter-parsers.org
  • vimPlugins.nvim-treesitter-parsers.pascal
  • vimPlugins.nvim-treesitter-parsers.passwd
  • vimPlugins.nvim-treesitter-parsers.pem
  • vimPlugins.nvim-treesitter-parsers.perl
  • vimPlugins.nvim-treesitter-parsers.php
  • vimPlugins.nvim-treesitter-parsers.php_only
  • vimPlugins.nvim-treesitter-parsers.phpdoc
  • vimPlugins.nvim-treesitter-parsers.pioasm
  • vimPlugins.nvim-treesitter-parsers.po
  • vimPlugins.nvim-treesitter-parsers.pod
  • vimPlugins.nvim-treesitter-parsers.poe_filter
  • vimPlugins.nvim-treesitter-parsers.pony
  • vimPlugins.nvim-treesitter-parsers.printf
  • vimPlugins.nvim-treesitter-parsers.prisma
  • vimPlugins.nvim-treesitter-parsers.promql
  • vimPlugins.nvim-treesitter-parsers.properties
  • vimPlugins.nvim-treesitter-parsers.proto
  • vimPlugins.nvim-treesitter-parsers.prql
  • vimPlugins.nvim-treesitter-parsers.psv
  • vimPlugins.nvim-treesitter-parsers.pug
  • vimPlugins.nvim-treesitter-parsers.puppet
  • vimPlugins.nvim-treesitter-parsers.purescript
  • vimPlugins.nvim-treesitter-parsers.pymanifest
  • vimPlugins.nvim-treesitter-parsers.python
  • vimPlugins.nvim-treesitter-parsers.ql
  • vimPlugins.nvim-treesitter-parsers.qmldir
  • vimPlugins.nvim-treesitter-parsers.qmljs
  • vimPlugins.nvim-treesitter-parsers.query
  • vimPlugins.nvim-treesitter-parsers.r
  • vimPlugins.nvim-treesitter-parsers.racket
  • vimPlugins.nvim-treesitter-parsers.ralph
  • vimPlugins.nvim-treesitter-parsers.rasi
  • vimPlugins.nvim-treesitter-parsers.rbs
  • vimPlugins.nvim-treesitter-parsers.re2c
  • vimPlugins.nvim-treesitter-parsers.readline
  • vimPlugins.nvim-treesitter-parsers.regex
  • vimPlugins.nvim-treesitter-parsers.rego
  • vimPlugins.nvim-treesitter-parsers.requirements
  • vimPlugins.nvim-treesitter-parsers.rnoweb
  • vimPlugins.nvim-treesitter-parsers.robot
  • vimPlugins.nvim-treesitter-parsers.roc
  • vimPlugins.nvim-treesitter-parsers.ron
  • vimPlugins.nvim-treesitter-parsers.rst
  • vimPlugins.nvim-treesitter-parsers.ruby
  • vimPlugins.nvim-treesitter-parsers.rust
  • vimPlugins.nvim-treesitter-parsers.scala
  • vimPlugins.nvim-treesitter-parsers.scfg
  • vimPlugins.nvim-treesitter-parsers.scheme
  • vimPlugins.nvim-treesitter-parsers.scss
  • vimPlugins.nvim-treesitter-parsers.slang
  • vimPlugins.nvim-treesitter-parsers.slint
  • vimPlugins.nvim-treesitter-parsers.smali
  • vimPlugins.nvim-treesitter-parsers.smithy
  • vimPlugins.nvim-treesitter-parsers.snakemake
  • vimPlugins.nvim-treesitter-parsers.solidity
  • vimPlugins.nvim-treesitter-parsers.soql
  • vimPlugins.nvim-treesitter-parsers.sosl
  • vimPlugins.nvim-treesitter-parsers.sourcepawn
  • vimPlugins.nvim-treesitter-parsers.sparql
  • vimPlugins.nvim-treesitter-parsers.sql
  • vimPlugins.nvim-treesitter-parsers.squirrel
  • vimPlugins.nvim-treesitter-parsers.ssh_config
  • vimPlugins.nvim-treesitter-parsers.starlark
  • vimPlugins.nvim-treesitter-parsers.strace
  • vimPlugins.nvim-treesitter-parsers.styled
  • vimPlugins.nvim-treesitter-parsers.supercollider
  • vimPlugins.nvim-treesitter-parsers.surface
  • vimPlugins.nvim-treesitter-parsers.svelte
  • vimPlugins.nvim-treesitter-parsers.swift
  • vimPlugins.nvim-treesitter-parsers.sxhkdrc
  • vimPlugins.nvim-treesitter-parsers.systemtap
  • vimPlugins.nvim-treesitter-parsers.t32
  • vimPlugins.nvim-treesitter-parsers.tablegen
  • vimPlugins.nvim-treesitter-parsers.tact
  • vimPlugins.nvim-treesitter-parsers.tcl
  • vimPlugins.nvim-treesitter-parsers.teal
  • vimPlugins.nvim-treesitter-parsers.templ
  • vimPlugins.nvim-treesitter-parsers.terraform
  • vimPlugins.nvim-treesitter-parsers.textproto
  • vimPlugins.nvim-treesitter-parsers.thrift
  • vimPlugins.nvim-treesitter-parsers.tiger
  • vimPlugins.nvim-treesitter-parsers.tlaplus
  • vimPlugins.nvim-treesitter-parsers.tmux
  • vimPlugins.nvim-treesitter-parsers.todotxt
  • vimPlugins.nvim-treesitter-parsers.toml
  • vimPlugins.nvim-treesitter-parsers.tsv
  • vimPlugins.nvim-treesitter-parsers.tsx
  • vimPlugins.nvim-treesitter-parsers.turtle
  • vimPlugins.nvim-treesitter-parsers.twig
  • vimPlugins.nvim-treesitter-parsers.typescript
  • vimPlugins.nvim-treesitter-parsers.typespec
  • vimPlugins.nvim-treesitter-parsers.typoscript
  • vimPlugins.nvim-treesitter-parsers.typst
  • vimPlugins.nvim-treesitter-parsers.udev
  • vimPlugins.nvim-treesitter-parsers.ungrammar
  • vimPlugins.nvim-treesitter-parsers.unison
  • vimPlugins.nvim-treesitter-parsers.usd
  • vimPlugins.nvim-treesitter-parsers.uxntal
  • vimPlugins.nvim-treesitter-parsers.v
  • vimPlugins.nvim-treesitter-parsers.vala
  • vimPlugins.nvim-treesitter-parsers.vento
  • vimPlugins.nvim-treesitter-parsers.verilog
  • vimPlugins.nvim-treesitter-parsers.vhs
  • vimPlugins.nvim-treesitter-parsers.vim
  • vimPlugins.nvim-treesitter-parsers.vimdoc
  • vimPlugins.nvim-treesitter-parsers.vue
  • vimPlugins.nvim-treesitter-parsers.wgsl
  • vimPlugins.nvim-treesitter-parsers.wgsl_bevy
  • vimPlugins.nvim-treesitter-parsers.wing
  • vimPlugins.nvim-treesitter-parsers.wit
  • vimPlugins.nvim-treesitter-parsers.xcompose
  • vimPlugins.nvim-treesitter-parsers.xml
  • vimPlugins.nvim-treesitter-parsers.yaml
  • vimPlugins.nvim-treesitter-parsers.yang
  • vimPlugins.nvim-treesitter-parsers.yuck
  • vimPlugins.nvim-treesitter-parsers.zathurarc
  • vimPlugins.nvim-treesitter-parsers.zig

@teto teto merged commit 51e6941 into NixOS:master Jun 30, 2024
22 checks passed
@teto
Copy link
Member

teto commented Jun 30, 2024

ty, I quickly rewrote the commit message to track the essence of the change

@MangoIV
Copy link
Contributor Author

MangoIV commented Jun 30, 2024

Thank you, yes that’s much better.

@linsui
Copy link
Contributor

linsui commented Jul 6, 2024

This causes problem. The query from parsers are not always compatible with neovim. I thought nvim-treesitter doesn't install queries.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

@linsui which grammar are you having issues with? Nvimtreesitter has its own queries in the repo but it definitely installs queries.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

Maybe that’s the problem, should we also check whether we should move queries at all?

@linsui
Copy link
Contributor

linsui commented Jul 6, 2024

The nix query from https://github.com/nix-community/tree-sitter-nix is not supported by neovim.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

I’ve not encountered any issue with the treesitter grammar of nix, do you install it in some special way?

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

I was of the impression that this function does not interact with nvim-treesitter at all. This is why I am a bit confused. Do you argue the function behaves in the wrong way now or does something now go wrong that went right before?

@linsui
Copy link
Contributor

linsui commented Jul 6, 2024

Because you don't install the query of nix from https://github.com/nix-community/tree-sitter-nix. You are using the one from nvim-treesitter. You can add the query to runtimepath before the query from nvim-treesitter so that it will be used.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

The I’d argue everything goes right, so you just want the parser from the repo you shared?

@linsui
Copy link
Contributor

linsui commented Jul 6, 2024

Yep. The query doesn't always work with neovim.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

Then I think you should replace the parser only. I think in the general case you want parser and query because if there’s no query, the entire thing doesn’t work.

@linsui
Copy link
Contributor

linsui commented Jul 6, 2024

For neovim, the query is vendored in nvim-treesitter. It currently works because the query from nvim-treesitter is put before the query from plugins.

@stasjok
Copy link
Contributor

stasjok commented Jul 6, 2024

I agree that this shouldn't be done for nvim-treesitter.withAllGrammars or nvim-treesitter.withPlugins. It results in duplicate query files in rtp (first one found in rtp is actually used if there is no extends modeline). The ones bundled with nvim-treesitter are tested and/or adapted for neovim. But the ones provided with parsers repository are not guaranteed to work in neovim (because there is no standard, especially for predicates). But for parsers that is installed separately without nvim-treesitter they can be useful.

@MangoIV
Copy link
Contributor Author

MangoIV commented Jul 6, 2024

Ah so this occurs in withAllGrammars and withPlugins. That needs fixing then.

@humemm
Copy link

humemm commented Aug 5, 2024

@MangoIV This pr causes a regression as mentioned in nvim-treesitter/nvim-treesitter#6870. In addition to causing problems with the nix grammar it messes with markdown/inline_markdown. Prior to nvim 10.0 it just breaks the markdown in vim help. Because of this issue markdown is displayed as source/plain text. After nvim 10.1 it throws errors like nix and hits the is-not predicate mentioned in that issue.

@teto
Copy link
Member

teto commented Aug 7, 2024

@humemm I've very quickly skimmed through the other post so I might be wrong but this seems like this PR fixed the installation of the queries, which triggers an error but this is not the fault of the PR. Just dont install the nix grammar or use a working version (I dont know if there is one but I am curious to know)

EDIT: you could also remove the query from the nix package or even just create an empty nix query in ~/.config/nvim to override the nix package's one

@humemm
Copy link

humemm commented Aug 8, 2024

@teto, as I mentioned above, this isn't just an issue with the nix grammar. Unfortunately, I'm not familiar with the internals of how treesitter grammars are handled in nix packages, so I can't offer a solution.

I'm also unclear about what you mean by saying this PR "fixed the installation of the queries." It seems like this PR resolved issues with some grammars while introducing problems with others.

Additionally, I'm not sure what issue this PR is addressing—the description is nearly empty, and no context was provided. I’d be happy to contribute and offer help, but...

It’s clear this wasn't "fixed" if we're forced to use hacky solutions or avoid installing grammars altogether. Why should one avoid installing the nix grammar? Could you please explain?

@xanderio
Copy link
Contributor

This PR is also causing the nushell queries to be places in $out/queries/nu/nu/.

BirdeeHub added a commit to BirdeeHub/nixpkgs that referenced this pull request Aug 17, 2024
Addresses issue NixOS#332580

Revert to NixOS#321550

It was finding the queries before. Adding them to where you would expect
throws an error. Removing them again afterwards during
the build process fixes the error.

It is weird, but that at least seems pretty clear to me.

Opening this as a draft so that if the decision is made to revert,
all that needs to be done is accept it.
PerchunPak added a commit to PerchunPak/nixpkgs that referenced this pull request Sep 10, 2024
A NixOS#319233 accidentally reverted NixOS#321550. Last one caused a very annoying
regression to any Nix user (see NixOS#332580). I suppose this is a bug in
upstream grammar, so I workaround it this way until it is properly
resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants