@@ -66,25 +66,34 @@ function! s:Paint() abort
66
66
for testproject in sort (keys (job.tests))
67
67
call add (lines , testproject)
68
68
for testfile in sort (keys (job.tests[testproject]))
69
- call add (lines , ' ' . fnamemodify (testfile, ' :.' ))
69
+ call add (lines , ' ' . fnamemodify (testfile, ' :.' ))
70
70
let tests = job.tests[testproject][testfile]
71
71
for name in sort (keys (tests), {a ,b - > tests[a ].lnum > tests[b ].lnum})
72
72
let test = tests[name]
73
73
let state = s: utils .state2char[test.state ]
74
- call add (lines , printf (' %s %s' , state , name))
74
+ call add (lines , printf (' %s %s' , state , name))
75
75
if state == # ' -' && ! has_key (test, ' spintimer' )
76
76
call s: spinner .start (test, len (lines ))
77
77
endif
78
78
let message = get (test, ' message' , [])
79
79
if len (message)
80
80
for messageline in message
81
- call add (lines , ' > ' . trim (messageline, ' ' , 2 ))
81
+ call add (lines , ' > ' . trim (messageline, ' ' , 2 ))
82
82
endfor
83
83
endif
84
84
let stacktrace = get (test, ' stacktrace' , [])
85
85
if len (stacktrace)
86
- for stacktraceline in stacktrace
87
- call add (lines , ' > ' . trim (stacktraceline, ' ' , 2 ))
86
+ for st in stacktrace
87
+ let line = trim (st .text)
88
+ if has_key (st , ' filename' )
89
+ let line = ' __ ' . line . ' __'
90
+ else
91
+ let line = ' _._ ' . line . ' _._'
92
+ endif
93
+ if has_key (st , ' lnum' )
94
+ let line .= ' line ' . st .lnum
95
+ endif
96
+ call add (lines , ' > ' . line )
88
97
endfor
89
98
endif
90
99
let output = get (test, ' output' , [])
@@ -137,13 +146,32 @@ endfunction
137
146
138
147
function ! s: UpdateState (bufnr , testnames, state , ... ) abort
139
148
let message = a: 0 ? a: 1 : []
140
- let stacktrace = a: 0 > 1 ? a: 2 : []
149
+ let stacktraceraw = a: 0 > 1 ? a: 2 : []
141
150
let output = a: 0 > 2 ? a: 3 : []
142
151
let projectname = s: utils .getProjectName (a: bufnr )
143
152
let filename = fnamemodify (bufname (a: bufnr ), ' :p' )
144
153
let tests = OmniSharp#GetHost (a: bufnr ).job.tests[projectname][filename]
145
154
for testname in a: testnames
146
155
if has_key (tests, testname)
156
+ let stacktrace = []
157
+ for st in stacktraceraw
158
+ let parsed = matchlist (st , ' at \(.\+\) in \([^:]\+\)\(:line \(\d\+\)\)\?' )
159
+ if len (parsed)
160
+ call add (stacktrace, {
161
+ \ ' text' : parsed[1 ],
162
+ \ ' filename' : parsed[2 ],
163
+ \ ' lnum' : str2nr (parsed[4 ])
164
+ \} )
165
+ else
166
+ let parsed = matchlist (st , ' at \(.\+\)' )
167
+ if len (parsed)
168
+ call add (stacktrace, {' text' : parsed[1 ]})
169
+ else
170
+ call add (stacktrace, {' text' : st })
171
+ endif
172
+ endif
173
+ endfor
174
+
147
175
let tests[testname].state = a: state
148
176
let tests[testname].message = message
149
177
let tests[testname].stacktrace = stacktrace
0 commit comments