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

Implement tree-sitter context queries. #104

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions queries/nvim/context.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
(module_def
body: (expressions) @context.end
) @context

(lib_def
body: (expressions) @context.end
) @context

(class_def
body: (expressions) @context.end
) @context

(struct_def
body: (expressions) @context.end
) @context

(enum_def
body: (expressions) @context.end
) @context

(c_struct_def
body: (expressions) @context.end
) @context

(union_def
body: (expressions) @context.end
) @context

(method_def
body: (expressions) @context.end
) @context

(fun_def
body: (expressions) @context.end
) @context

(macro_def
body: (expressions) @context.end
) @context

devnote-dev marked this conversation as resolved.
Show resolved Hide resolved
(block
body: (expressions) @context.end
) @context

(if
then: (then) @context.end
) @context

(unless
then: (then) @context.end
) @context

(case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also select

(when) @context.end
devnote-dev marked this conversation as resolved.
Show resolved Hide resolved
) @context

(select
(when) @context.end
) @context

(case
(in) @context.end
) @context

(when
body: (expressions) @context.end
) @context

(in
body: (expressions) @context.end
) @context

(while
devnote-dev marked this conversation as resolved.
Show resolved Hide resolved
body: (expressions) @context.end
) @context

(until
body: (expressions) @context.end
) @context
Loading