Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #473 from jbradberry/remove_called_by_filter
Browse files Browse the repository at this point in the history
Removed the called-by filter.
  • Loading branch information
erikrose committed Oct 26, 2015
2 parents ab22e97 + 0e7d98f commit f879f4d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dxr/plugins/clang/tests/test_callers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for searches using callers and called-by"""
"""Tests for searches using callers"""

from dxr.testing import SingleFileTestCase, MINIMAL_MAIN

Expand Down
7 changes: 3 additions & 4 deletions dxr/plugins/python/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
'py_derived': QUALIFIED_LINE_NEEDLE,
'py_bases': QUALIFIED_LINE_NEEDLE,
'py_callers': QUALIFIED_LINE_NEEDLE,
'py_called_by': QUALIFIED_LINE_NEEDLE,
'py_overrides': QUALIFIED_LINE_NEEDLE,
'py_overridden': QUALIFIED_LINE_NEEDLE,
},
Expand Down Expand Up @@ -92,14 +91,14 @@ def visit_FunctionDef(self, node):
start, end = self.file_to_index.get_node_start_end(node)
self.yield_needle('py_function', node.name, start, end)

# Index function calls within this function for the callers: and
# called-by filters.
# Index function calls within this function for the callers: filter.
self.function_call_stack.append([])
super(IndexingNodeVisitor, self).visit_FunctionDef(node)
call_needles = self.function_call_stack.pop()
for name, call_start, call_end in call_needles:
# TODO: py_callers should be all calls, not just ones that
# take place within a function.
self.yield_needle('py_callers', name, start, end)
self.yield_needle('py_called_by', node.name, call_start, call_end)

def visit_Call(self, node):
# Save this call if we're currently tracking function calls.
Expand Down
2 changes: 0 additions & 2 deletions dxr/plugins/rust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def all_needles(self):
self.fn_impls_needles(),
self.inherit_needles(self.tree_index.super_traits, 'derived'),
self.inherit_needles(self.tree_index.sub_traits, 'bases'),
self.call_needles(self.tree_index.callers, 'called_by'),
self.call_needles(self.tree_index.callees, 'callers'),
))))

Expand Down Expand Up @@ -1055,7 +1054,6 @@ def process_end_external_crates(args, tree):
'rust_bases': QUALIFIED_LINE_NEEDLE,
'rust_derived': QUALIFIED_LINE_NEEDLE,
'rust_callers': QUALIFIED_LINE_NEEDLE,
'rust_called_by': QUALIFIED_LINE_NEEDLE,
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions dxr/plugins/rust/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class CallersFilter(_QualifiedNameFilter):
is_reference = True
description = 'Function callers'

class CalledByFilter(_QualifiedNameFilter):
name = 'called-by'
description = 'Functions called by this function'

class FnImplsFilter(_QualifiedNameFilter):
name = 'fn-impls'
is_identifier = True
Expand Down
6 changes: 1 addition & 5 deletions dxr/plugins/rust/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ def add_link_to_menu(url, html, title):

def call_menu(qualname, tree):
return [{'html': "Find callers",
'title': "Find functions that call this function",
'title': "Find calls of this function",
'href': search_url(tree, "+callers:%s" % quote(qualname)),
'icon': 'method'},
{'html': "Find callees", # TODO: Probably useless. Remove.
'title': "Find functions that are called by this function",
'href': search_url(tree, "+called-by:%s" % quote(qualname)),
'icon': 'method'}]


Expand Down

0 comments on commit f879f4d

Please sign in to comment.