def handler(message): watch = self._variable_eval if watch.result is None: watch.result = WatchResult(message['body']) else: watch.result.Update(message['body']) popup_win_id = utils.DisplayBalloon(self._is_term, [], is_hover) # record the global eval window id vim.vars['vimspector_session_windows']['eval'] = int(popup_win_id) popup_bufnr = int(vim.eval("winbufnr({})".format(popup_win_id))) # We don't need to do any UI window setup here, as it's already done as # part of the popup creation, so just pass the buffer to the View instance self._variable_eval_view = BufView(vim.buffers[popup_bufnr], {}, self._DrawBalloonEval) if watch.result.IsExpandable(): # Always expand the first level watch.result.expanded = Expandable.EXPANDED_BY_US if watch.result.IsExpanded(): self._connection.DoRequest( partial(self._ConsumeVariables, self._variable_eval_view.draw, watch.result), { 'command': 'variables', 'arguments': { 'variablesReference': watch.result.VariablesReference(), }, }) self._DrawBalloonEval()
def failure_handler(reason, message): display = [reason] float_win_id = utils.DisplayBalloon(self._is_term, display, is_hover) # record the global eval window id vim.vars['vimspector_session_windows']['eval'] = int(float_win_id)