Esempio n. 1
0
 def _postWarning(self, msg):
     """
     Post warnings to the user once
     """
     if ('warn', msg) not in self._posted_notifications:
         self._posted_notifications += [('warn', msg)]
         vim_helpers.postVimWarning(msg)
Esempio n. 2
0
 def _postWarning(self, msg):
     """
     Post warnings to the user once
     """
     if ('warn', msg) not in self._posted_notifications:
         self._posted_notifications += [('warn', msg)]
         vim_helpers.postVimWarning(msg)
Esempio n. 3
0
 def postQueuedMessages(self):
     '''Because Vim doesn't allows commands from non-GUI threads,
     we enqueue messages generated by background threads and post
     them whenever Vim is ready'''
     while not self._ui_msg_queue.empty():
         msg = self._ui_msg_queue.get()
         if msg['type'] == 'info':
             vim_helpers.postVimInfo(msg['text'])
         elif msg['type'] == 'warning':
             vim_helpers.postVimWarning(msg['text'])
         elif msg['type'] == 'error':
             vim_helpers.postVimError(msg['text'])
Esempio n. 4
0
 def _postQueuedMessages(self):
     "Empty our queue in a single message"
     while not self._ui_queue.empty():
         messages = self._ui_queue.get()
         for severity, message in messages.json().get('ui_messages', []):
             if severity == 'info':
                 vim_helpers.postVimInfo(message)
             elif severity == 'warning':
                 vim_helpers.postVimWarning(message)
             elif severity == 'error':
                 vim_helpers.postVimError(message)
             else:
                 vim_helpers.postVimError(
                     "Unknown severity '%s' for message '%s'" %
                     (severity, message))
Esempio n. 5
0
    def rebuildProject(self):
        """
        Rebuilds the current project
        """
        if vim.eval('&filetype') not in ('vhdl', 'verilog', 'systemverilog'):
            vim_helpers.postVimWarning("Not a VHDL file, can't rebuild")
            return

        vim_helpers.postVimInfo("Rebuilding project...")
        project_file = vim_helpers.getProjectFile()
        request = RequestProjectRebuild(project_file=project_file)

        response = request.sendRequest()

        if response is None:
            return "hdlcc server is not running"

        self._logger.info("Response: %s", repr(response))
Esempio n. 6
0
 def test():
     vim_helpers.postVimWarning("Some warning")
     vim.command.assert_called_with(
         "redraw | echohl WarningMsg | echom 'Some warning' | echohl None")
Esempio n. 7
0
 def _postError(self, msg):
     "Post errors to the user once"
     if ('error', msg) not in self._posted_notifications:
         self._posted_notifications += [('error', msg)]
         vim_helpers.postVimWarning(msg)
Esempio n. 8
0
 def test():
     vim_helpers.postVimWarning("Some warning")
     vim.command.assert_called_with(
         "redraw | echohl WarningMsg | echom 'Some warning' | echohl None")