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

Make predicate with missing capture return true #164

Merged
merged 1 commit into from
Nov 12, 2023

Commits on Nov 12, 2023

  1. fix: make predicate with a missing capture return True

    If a predicate in a query references a capture that was not matched
    because it was optional in the query, return true rather than throw an
    error. In other words, if the capture was not found, ignore the
    predicate entirely.
    
    This matches the behavior of tree-sitter CLI and the playground. It
     is not a common case but we have run into the issue matching Kotlin functions
    where the return type of a function is optional in the grammar requiring
    us to do additional filtering in the app code after the query.
    jhandley authored and amaanq committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    2ee6960 View commit details
    Browse the repository at this point in the history