Skip to content

Commit

Permalink
make sure type in status is cleared, disable checks on regions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomv564 committed Nov 4, 2015
1 parent 413cb83 commit d7ab889
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/test_listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_type_at_cursor_tests(self):
listener.on_selection_modified(view)

view.set_status.assert_called_with("type_at_cursor", type_info)
view.add_regions.assert_called_with("type_at_cursor", ANY, "storage.type", "", sublime.DRAW_OUTLINED)
#view.add_regions.assert_called_with("type_at_cursor", ANY, "storage.type", "", sublime.DRAW_OUTLINED)

def test_request_completions(self):

Expand Down
2 changes: 1 addition & 1 deletion test/test_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_highlight_type_clear(self):
Win(window).highlight_type([])

view.set_status.assert_called_with("type_at_cursor", "")
view.add_regions.assert_called_with("type_at_cursor", [], "storage.type", "", sublime.DRAW_OUTLINED)
#view.add_regions.assert_called_with("type_at_cursor", [], "storage.type", "", sublime.DRAW_OUTLINED)

def test_highlight_no_errors(self):

Expand Down
15 changes: 11 additions & 4 deletions win.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,19 @@ def highlight_type(self, exp_types):
"""
type_spans = list(parse_exp_types(exp_types))
if type_spans:
_view = self.window.active_view()
_type = next(filter_enclosing(_view, _view.sel()[0], type_spans), None)
view = self.window.active_view()
_type = next(filter_enclosing(view, view.sel()[0], type_spans), None)
if not _type is None:
_view.set_status("type_at_cursor", _type)
view.set_status("type_at_cursor", _type)
#view.add_regions("type_at_cursor", [view_region_from_span(view, span)], "storage.type", "", sublime.DRAW_OUTLINED)
if Win.show_popup:
_view.show_popup(shorten_module_prefix(_type))
view.show_popup(shorten_module_prefix(_type))
return

# Clear type-at-cursor display
for view in self.window.views():
view.set_status("type_at_cursor", "")
# view.add_regions("type_at_cursor", [], "storage.type", "", sublime.DRAW_OUTLINED)


def handle_source_errors(self, source_errors):
Expand Down

0 comments on commit d7ab889

Please sign in to comment.