def on_hover(self, view, point, hover_zone):
# Popup only on text
if hover_zone != sublime.HOVER_TEXT:
return
# Check file size to optionnaly disable the feature (finding the information can be quite long)
threshold = view.settings().get('vhdl.hover_max_size',-1)
if view.size() > threshold and threshold!=-1 :
return
# Only show a popup for vhdl, when not in a string of a comment
scope = view.scope_name(point)
if 'source.vhdl' not in scope:
return
if any(w in scope for w in ['comment', 'string', 'keyword']):
return
popup = VhdlTypePopup(view)
sublime.set_timeout_async(lambda r=view.word(point), p=point: popup.show(r,p))
评论列表
文章目录