It all depends on what you’re going for. ScopeHunter gets the scope at the given point and then searches the view for that exact scope and filters it to just show the region under the cursor.
if self.show_popup:
if self.points_info:
self.template_vars["pt_extent"] = True
self.template_vars["extent_start"] = pts.begin()
self.template_vars["extent_end"] = pts.end()
self.template_vars["extent_pt_index"] = self.next_index()
if self.rowcol_info:
self.template_vars["rowcol_extent"] = True
self.template_vars["l_start"] = row1 + 1
self.template_vars["l_end"] = row2 + 1
self.template_vars["c_start"] = col1 + 1
self.template_vars["c_end"] = col2 + 1
self.template_vars["line_char_index"] = self.next_index()
def get_scope(self, pt):
"""Get the scope at the cursor."""
scope = self.view.scope_name(pt)
spacing = "\n" + (" " * 31)