Python sublime 模块,HOVER_TEXT 实例源码

我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用sublime.HOVER_TEXT

项目:EasyClangComplete    作者:niosus    | 项目源码 | 文件源码
def on_hover(self, view, point, hover_zone):
        """Call this when mouse pointer hovers over text.

        Triggers showing popup with additional information about element under
        cursor.

        """
        if not Tools.is_valid_view(view):
            return

        settings = EasyClangComplete.settings_manager.settings_for_view(view)
        if not settings.show_type_info:
            return
        if hover_zone != sublime.HOVER_TEXT:
            return
        tooltip_request = tools.ActionRequest(view, point)
        self.current_job_id = tooltip_request.get_identifier()

        job = ThreadJob(
            name=ThreadJob.INFO_TAG,
            callback=self.info_finished,
            function=EasyClangComplete.view_config_manager.trigger_info,
            args=[view, tooltip_request, settings])
        EasyClangComplete.thread_pool.new_job(job)
项目:SmartVHDL    作者:TheClams    | 项目源码 | 文件源码
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))
项目:SourceKittenSubl    作者:Dan2552    | 项目源码 | 文件源码
def on_hover(self, view, point, hover_zone):
        self.view = view
        file = view.file_name()
        if not _is_swift(file):
            return

        if hover_zone != sublime.HOVER_TEXT:
            return

        project_directory = _project_directory(view)
        text = _view_text(view)

        text = subl_source_kitten.popup(point, file, project_directory, text)

        view.show_popup(text,
                        sublime.HIDE_ON_MOUSE_MOVE_AWAY,
                        point,
                        600,
                        600,
                        self.on_navigate,
                        self.on_hide)
项目:CompletePHP    作者:desean1625    | 项目源码 | 文件源码
def on_hover(self, view, point, hover_zone):
        if "PHP" not in view.settings().get('syntax'):
            return
        self.settings = sublime.load_settings('CompletePHP.sublime-settings')
        if self.settings.get('showInlineDocsOnHover') == False:
            return
        if hover_zone != sublime.HOVER_TEXT:
            return
        wordregion = view.word(point)
        word = view.substr(wordregion).lower()
        print(word)
        self.show_doc_popup(view, point, word)
项目:DXMate    作者:jtowers    | 项目源码 | 文件源码
def handle_hover(view, point, hover_zone):
    if util.is_apex_file(view):
        if hover_zone != sublime.HOVER_TEXT or view.is_popup_visible():
            return
        util.debug('handling hover')
        line_diagnostics = get_line_diagnostics(view, point)
        if line_diagnostics:
            show_diagnostics_hover(view, point, line_diagnostics)
项目:LSP    作者:tomv564    | 项目源码 | 文件源码
def on_hover(self, point, hover_zone):
        if hover_zone != sublime.HOVER_TEXT or self.view.is_popup_visible():
            return
        self.request_symbol_hover(point)
        point_diagnostics = get_point_diagnostics(self.view, point)
        if point_diagnostics:
            self.show_hover(point, self.diagnostics_content(point_diagnostics))
项目:SourceKittenSubl    作者:Dan2552    | 项目源码 | 文件源码
def run(self, edit):
        point = self.view.sel()[0].begin()
        SublCompletions().on_hover(self.view, point, sublime.HOVER_TEXT)
项目:ToolTip-Helper    作者:doobleweb    | 项目源码 | 文件源码
def on_hover(self, view, point, hover_zone):
        # run hover only if its text
        if hover_zone == sublime.HOVER_TEXT:
            a = ToolTipHelperCommand(view, point);
            a.run('');