Fix #86 - JDB eval show both eval
and dump
of object
This commit is contained in:
parent
9bf2984d13
commit
15ab930a6c
@ -198,15 +198,48 @@ function! vebugger#jdb#_executeStatements(writeAction,debugger)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! vebugger#jdb#_readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
||||
if 'out'==a:pipeName
|
||||
let l:matches=matchlist(a:line,'\v^%(\s*%(%(%(\w|\.)+)\[\d+\] )+)? ([^=]+) \= (.*)$')
|
||||
if 3<len(l:matches)
|
||||
let l:expression=l:matches[1]
|
||||
let l:value=l:matches[2]
|
||||
let a:readResult.std.evaluatedExpression={
|
||||
\'expression':(l:expression),
|
||||
\'value':(l:value)}
|
||||
function! vebugger#jdb#_readEvaluatedExpressions(pipeName, line, readResult, debugger) dict
|
||||
if 'out' == a:pipeName
|
||||
let l:matches = matchlist(a:line, '\v^%(\s*%(%(%(\w|\.)+)\[\d+\] )+)? ([^=]+) \= (.*)$')
|
||||
if !has_key(self, 'evalContext')
|
||||
if 3 < len(l:matches)
|
||||
let l:expression = l:matches[1]
|
||||
let l:value = l:matches[2]
|
||||
if l:value == 'null'
|
||||
let a:readResult.std.evaluatedExpression = {
|
||||
\ 'expression': l:expression,
|
||||
\ 'value': l:value}
|
||||
else
|
||||
let self.evalContext = {
|
||||
\ 'expression': l:expression,
|
||||
\ 'dumpCommand': 'dump ' . l:expression,
|
||||
\ 'dumpStart': ' ' . l:expression . ' = {',
|
||||
\ 'lines': [l:value],
|
||||
\ 'dumpStarted': 0,
|
||||
\ }
|
||||
call a:debugger.writeLine(self.evalContext.dumpCommand)
|
||||
endif
|
||||
endif
|
||||
else
|
||||
if vebugger#util#endsWith(a:line, self.evalContext.dumpCommand)
|
||||
elseif a:line == self.evalContext.dumpStart
|
||||
call add(self.evalContext.lines, '{')
|
||||
let self.evalContext.dumpStart = 1
|
||||
elseif !self.evalContext.dumpStarted && 3 < len(l:matches)
|
||||
let a:readResult.std.evaluatedExpression = {
|
||||
\ 'expression': self.evalContext.expression,
|
||||
\ 'value': join(self.evalContext.lines, "\n")}
|
||||
unlet self.evalContext
|
||||
else
|
||||
call add(self.evalContext.lines, a:line)
|
||||
endif
|
||||
if a:line == '}'
|
||||
let a:readResult.std.evaluatedExpression = {
|
||||
\ 'expression': self.evalContext.expression,
|
||||
\ 'value': join(self.evalContext.lines, "\n")}
|
||||
|
||||
unlet self.evalContext
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
@ -168,3 +168,7 @@ endfunction
|
||||
function! vebugger#util#listSignsInFile(filename) abort
|
||||
return s:listSigns('file='.a:filename)
|
||||
endfunction
|
||||
|
||||
function! vebugger#util#endsWith(string, endsWith) abort
|
||||
return a:string[-len(a:endsWith):] == a:endsWith
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user