GithubHelp home page GithubHelp logo

Comments (8)

clason avatar clason commented on July 17, 2024 3
  • "Mom, can we get more treesitter tests?"
  • "We have treesitter tests at home".

treesitter tests at home

from neovim.

lewis6991 avatar lewis6991 commented on July 17, 2024 1

This is most definitely because we've switched from iter_captures to iter_matches.

I don't think this is intended. We can add the repro steps as a testcase to prevent this happening again, but I'm surprised our current tests don't capture this in some way.

from neovim.

lewis6991 avatar lewis6991 commented on July 17, 2024
  • "Mom, can we get more treesitter tests?"
  • "We have treesitter tests at home".

treesitter tests at home

In that case, would it be worth adding nvim-treesitters CI to Neovim's CI? It would certainly boost coverage.

from neovim.

gpanders avatar gpanders commented on July 17, 2024

How did this even work before with iter_captures? Does ts_query_cursor_next_capture order iterated nodes based on "specificity"? As far as I can tell, we are not doing anything on the Neovim side to do this ordering. The old highlighter that use iter_captures just applied extmarks in the exact order returned from the iterator.

from neovim.

gpanders avatar gpanders commented on July 17, 2024

It'd also be fine to just not consider specificity anymore, that's totally fine but some queries need to be reworked then (e.g. some of C's highlights) and this should be documented to avoid further confusion

I do think we should do this too and make the order defined in the query the only thing that influences priority. Having two separate metrics that influence priority is confusing. But in the interest of supporting BWC we should still fix this in the meantime.

from neovim.

clason avatar clason commented on July 17, 2024

In that case, would it be worth adding nvim-treesitters CI to Neovim's CI? It would certainly boost coverage.

Actually, I'd claim we should do the converse: add a treesitter highlight test suite (mirroring tree-sitter test, but using our highlighter instead of the Rust crate -- either tree-sitter's or theHamsta's) exercising the bundled queries and expose it in a way that nvim-treesitter can steal leverage.

from neovim.

lucario387 avatar lucario387 commented on July 17, 2024

How did this even work before with iter_captures

iter_captures return the results based on the order of a node in the tree, so the outer appears before the inner and so on

from neovim.

lewis6991 avatar lewis6991 commented on July 17, 2024

The repro in the OP actually caused the highlighter to error when I added it as a testcase. Haven't got time to debug, but using iter_captures as before works fine.

from neovim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.