tags: Add @ignore capture

This commit is contained in:
Max Brunsfeld 2020-07-29 15:30:13 -07:00
parent 4ec7d80968
commit e89a19a158
2 changed files with 153 additions and 109 deletions

View file

@ -68,11 +68,13 @@ const JS_TAG_QUERY: &'static str = r#"
const RUBY_TAG_QUERY: &'static str = r#"
(method
name: (identifier) @name) @definition.method
name: (_) @name) @definition.method
(method_call
method: (identifier) @name) @reference.call
(setter (identifier) @ignore)
((identifier) @name @reference.call
(#is-not? local))
"#;
@ -207,7 +209,7 @@ fn test_tags_ruby() {
"
b = 1
def foo()
def foo=()
c = 1
# a is a method because it is not in scope
@ -239,7 +241,7 @@ fn test_tags_ruby() {
))
.collect::<Vec<_>>(),
&[
("foo", "method", (2, 4)),
("foo=", "method", (2, 4)),
("bar", "call", (7, 4)),
("a", "call", (7, 8)),
("b", "call", (7, 11)),