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

feat: allow rules to be treesitter context aware (#423) #424

Merged
merged 2 commits into from Jan 21, 2024

Commits on Jan 20, 2024

  1. feat: allow rules to be treesitter context aware

    When a rule is defined with the `:with_context()` method, has a
    specified filetype, and is operating in a buffer with a treesitter
    parser attached, the rule will only execute iff the treesitter language
    at the cursor matches one of the filetypes specified in the initial rule
    definition.
    
    > If there are no specified filetypes, of there is no parser attached to
    > the current buffer, the rule executes as normal
    kamalsacranie committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    ba2bd2b View commit details
    Browse the repository at this point in the history
  2. Add tests for treesitter context in markdown sample

    - Add 'ts_context markdown `*` success md_context'
    - Add 'ts_context codeblock `*` fail js_context'
    kamalsacranie committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    bd41c43 View commit details
    Browse the repository at this point in the history