def on_selection_modified(self, view):

        if not is_haskell_view(view):
            return

        window = view.window()
        if not StackIDEManager.is_running(window):
            return

        # Only try to get types for views into files
        # (rather than e.g. the find field or the console pane)
        if view.file_name():
            # Uncomment to see the scope at the cursor:
            # Log.debug(view.scope_name(view.sel()[0].begin()))
            request = Req.get_exp_types(span_from_view_selection(view))
            send_request(window, request, Win(window).highlight_type)
    def on_selection_modified(self, view):

        if not is_haskell_view(view):
            return

        window = view.window()
        if not StackIDEManager.is_running(window):
            return

        # Only try to get types for views into files
        # (rather than e.g. the find field or the console pane)
        if view.file_name():
            # Uncomment to see the scope at the cursor:
            # Log.debug(view.scope_name(view.sel()[0].begin()))
            request = Req.get_exp_types(span_from_view_selection(view))
            send_request(window, request, Win(window).highlight_type)
    def on_query_completions(self, view, prefix, locations):

        if not is_haskell_view(view):
            return

        window = view.window()
        if not StackIDEManager.is_running(window):
            return
        # Check if this completion query is due to our refreshing the completions list
        # after receiving a response from stack-ide, and if so, don't send
        # another request for completions.
        if not self.refreshing:
            self.view = view
            request = Req.get_autocompletion(filepath=relative_view_file_name(view),prefix=prefix)
            send_request(window, request, self._handle_response)

        # Clear the flag to allow future completion queries
        self.refreshing = False
        return list(self.format_completion(*completion) for completion in self.returned_completions)
    def on_query_completions(self, view, prefix, locations):

        if not is_haskell_view(view):
            return

        window = view.window()
        if not StackIDEManager.is_running(window):
            return
        # Check if this completion query is due to our refreshing the completions list
        # after receiving a response from stack-ide, and if so, don't send
        # another request for completions.
        if not self.refreshing:
            self.view = view
            request = Req.get_autocompletion(
                filepath=relative_view_file_name(view), prefix=prefix)
            send_request(window, request, self._handle_response)

        # Clear the flag to allow future completion queries
        self.refreshing = False
        return list(
            self.format_completion(*completion)
            for completion in self.returned_completions)
示例#5
0
 def run(self,edit):
     request = Req.get_exp_info(span_from_view_selection(self.view))
     send_request(self.view.window(),request, self._handle_response)