helix icon indicating copy to clipboard operation
helix copied to clipboard

Reverse query precedence ordering

Open the-mikedavis opened this issue 1 year ago • 4 comments

This is a work in progress: we need to check the other tree-sitter queries (injections, indents, textobjects) and ensure that they also use the latest match. We also need to re-order and check all of the existing highlight queries. For now I've started small and only ported over Erlang's highlights.

Closes https://github.com/helix-editor/helix/issues/9436

Progress
  • [ ] ada
  • [x] adl
  • [ ] agda
  • [x] astro
  • [x] awk
  • [x] bash
  • [ ] bass
  • [x] beancount
  • [x] bibtex
  • [x] bicep
  • [x] bitbake
  • [x] blade
  • [ ] blueprint
  • [x] c
  • [x] cairo
  • [x] capnp
  • [x] cel
  • [x] clojure
  • [ ] cmake
  • [ ] comment
  • [x] common-lisp
  • [x] cpon
  • [ ] cpp
  • [ ] crystal
  • [ ] c-sharp
  • [ ] css
  • [x] cue
  • [ ] d
  • [ ] dart
  • [ ] dbml
  • [ ] devicetree
  • [ ] dhall
  • [x] diff
  • [x] docker-compose
  • [x] dockerfile
  • [x] dot
  • [x] dtd
  • [ ] earthfile
  • [ ] ecma
  • [ ] edoc
  • [ ] eex
  • [x] ejs
  • [ ] elixir
  • [ ] elm
  • [ ] elvish
  • [x] env
  • [x] erb
  • [x] erlang
  • [ ] esdl
  • [ ] fidl
  • [ ] fish
  • [ ] forth
  • [ ] fortran
  • [ ] fsharp
  • [x] gas
  • [ ] gdscript
  • [x] gemini
  • [x] git-attributes
  • [ ] git-commit
  • [ ] git-config
  • [ ] git-ignore
  • [x] git-rebase
  • [ ] _gjs
  • [ ] gjs
  • [ ] gleam
  • [ ] glimmer
  • [ ] glsl
  • [x] gn
  • [x] go
  • [x] godot-resource
  • [x] gomod
  • [ ] gotmpl
  • [x] gowork
  • [x] graphql
  • [ ] groovy
  • [x] gts
  • [ ] hare
  • [x] haskell
  • [x] haskell-persistent
  • [ ] hcl
  • [ ] heex
  • [x] helm
  • [ ] hocon
  • [ ] hoon
  • [x] hosts
  • [x] html
  • [ ] hurl
  • [ ] hyprlang
  • [x] iex
  • [x] ini
  • [ ] inko
  • [x] janet
  • [x] java
  • [ ] _javascript
  • [ ] javascript
  • [ ] jinja
  • [ ] jsdoc
  • [ ] json
  • [ ] json5
  • [ ] jsonc
  • [ ] jsonnet
  • [ ] _jsx
  • [ ] jsx
  • [x] julia
  • [ ] just
  • [ ] kdl
  • [ ] koka
  • [ ] kotlin
  • [ ] latex
  • [x] ld
  • [ ] ldif
  • [ ] lean
  • [ ] ledger
  • [ ] llvm
  • [ ] llvm-mir
  • [ ] llvm-mir-yaml
  • [x] log
  • [ ] lpf
  • [ ] lua
  • [ ] make
  • [ ] markdoc
  • [ ] markdown
  • [ ] markdown.inline
  • [ ] matlab
  • [ ] mermaid
  • [ ] meson
  • [ ] mojo
  • [x] move
  • [x] msbuild
  • [ ] nasm
  • [ ] nickel
  • [ ] nim
  • [ ] nix
  • [ ] nu
  • [x] nunjucks
  • [ ] ocaml
  • [ ] ocaml-interface
  • [ ] odin
  • [ ] ohm
  • [ ] opencl
  • [x] openscad
  • [ ] org
  • [ ] pascal
  • [x] passwd
  • [x] pem
  • [ ] perl
  • [x] pest
  • [ ] php
  • [ ] php-only
  • [x] pkgbuild
  • [ ] pkl
  • [ ] po
  • [ ] pod
  • [ ] ponylang
  • [ ] powershell
  • [ ] prisma
  • [ ] protobuf
  • [ ] prql
  • [x] purescript
  • [ ] python
  • [ ] qml
  • [ ] r
  • [ ] racket
  • [x] regex
  • [ ] rego
  • [ ] rescript
  • [x] rmarkdown
  • [ ] robot
  • [x] ron
  • [x] rst
  • [ ] ruby
  • [ ] rust
  • [ ] sage
  • [ ] scala
  • [x] scheme
  • [ ] scss
  • [ ] slint
  • [ ] smali
  • [ ] smithy
  • [x] sml
  • [ ] solidity
  • [x] spicedb
  • [x] sql
  • [x] sshclientconfig
  • [x] starlark
  • [x] strace
  • [x] supercollider
  • [ ] svelte
  • [ ] sway
  • [ ] swift
  • [ ] t32
  • [ ] tablegen
  • [ ] tact
  • [ ] task
  • [ ] tcl
  • [ ] templ
  • [x] tfvars
  • [x] todotxt
  • [x] toml
  • [ ] tsq
  • [ ] tsx
  • [x] twig
  • [ ] _typescript
  • [ ] typescript
  • [ ] typst
  • [x] ungrammar
  • [ ] unison
  • [x] uxntal
  • [ ] v
  • [ ] vala
  • [ ] verilog
  • [ ] vhdl
  • [x] vhs
  • [x] vue
  • [x] wast
  • [x] wat
  • [x] webc
  • [ ] wgsl
  • [ ] wit
  • [ ] wren
  • [x] xit
  • [ ] xml
  • [x] xtc
  • [x] yaml
  • [ ] yuck
  • [ ] zig

TODO: also verify locals, indents

the-mikedavis avatar Jan 28 '24 19:01 the-mikedavis

dump question: couldn't we simply write a script that reads all queries and reverses all lines?

It would be ugly but at least trivially correct.

pascalkuthe avatar Jan 28 '24 22:01 pascalkuthe

It would probably be a little tricky to write so that it handles comments correctly but yeah that would be the most efficient way

the-mikedavis avatar Jan 28 '24 23:01 the-mikedavis

There's also files that were copied and weren't properly reversed in the first place

archseer avatar Jan 29 '24 04:01 archseer

I added a progress checklist to the PR description. I'm going through these one by one and comparing them to the nvim-treesitter ordering: in many cases there's nothing to do or the file wasn't correctly reordered in the first place.

archseer avatar May 20 '24 10:05 archseer