Do not use tags for callstack, only for current location. Otherwise, it's unusably slow.
This commit is contained in:
parent
08b7b5dabd
commit
b9517ade8c
@ -68,7 +68,7 @@ function! s:getTagContainingString(tag, str)
|
|||||||
return {}
|
return {}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:findFolderFromStackTrace(src,nameFromStackTrace)
|
function! s:findFolderFromStackTrace(src,nameFromStackTrace,frameNumber)
|
||||||
" Remove method name.
|
" Remove method name.
|
||||||
let l:canonicalClassName = strpart(a:nameFromStackTrace, 0, strridx(a:nameFromStackTrace, "."))
|
let l:canonicalClassName = strpart(a:nameFromStackTrace, 0, strridx(a:nameFromStackTrace, "."))
|
||||||
" Remove package name.
|
" Remove package name.
|
||||||
@ -76,7 +76,9 @@ function! s:findFolderFromStackTrace(src,nameFromStackTrace)
|
|||||||
" Remove class name.
|
" Remove class name.
|
||||||
let l:package = strridx(l:canonicalClassName, ".") >= 0 ? strpart(l:canonicalClassName, 0, strridx(l:canonicalClassName, ".")) : ""
|
let l:package = strridx(l:canonicalClassName, ".") >= 0 ? strpart(l:canonicalClassName, 0, strridx(l:canonicalClassName, ".")) : ""
|
||||||
|
|
||||||
if exists('g:vebugger_use_tags') && g:vebugger_use_tags
|
" We don't really use callstack, so we use tags only for the current location.
|
||||||
|
" Otherwise it makes everything too slow.
|
||||||
|
if exists('g:vebugger_use_tags') && g:vebugger_use_tags && a:frameNumber == 1
|
||||||
" Now first try to find a tag for the class from the required package.
|
" Now first try to find a tag for the class from the required package.
|
||||||
let l:classTag = s:getTagContainingString(l:simpleClassName, l:package)
|
let l:classTag = s:getTagContainingString(l:simpleClassName, l:package)
|
||||||
if (has_key(l:classTag, "filename"))
|
if (has_key(l:classTag, "filename"))
|
||||||
@ -100,9 +102,9 @@ function! vebugger#jdb#_readWhere(pipeName,line,readResult,debugger)
|
|||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v\s*\[(\d+)]\s*(\S+)\s*\(([^:]*):(\d*)\)')
|
let l:matches=matchlist(a:line,'\v\s*\[(\d+)]\s*(\S+)\s*\(([^:]*):(\d*)\)')
|
||||||
if 4<len(l:matches)
|
if 4<len(l:matches)
|
||||||
let l:file=s:findFolderFromStackTrace(a:debugger.state.jdb.srcpath,l:matches[2]).'/'.l:matches[3]
|
|
||||||
let l:file=fnamemodify(l:file,':~:.')
|
|
||||||
let l:frameNumber=str2nr(l:matches[1])
|
let l:frameNumber=str2nr(l:matches[1])
|
||||||
|
let l:file=s:findFolderFromStackTrace(a:debugger.state.jdb.srcpath,l:matches[2],l:frameNumber).'/'.l:matches[3]
|
||||||
|
let l:file=fnamemodify(l:file,':~:.')
|
||||||
if 1==l:frameNumber " first stackframe is the current location
|
if 1==l:frameNumber " first stackframe is the current location
|
||||||
let a:readResult.std.location={
|
let a:readResult.std.location={
|
||||||
\'file':(l:file),
|
\'file':(l:file),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user