@@ -19,7 +19,7 @@ export interface StackViewModel {
1919
2020export interface FrameViewModel extends ErrorFlowFrame {
2121 id : number ;
22- stackIndex : number ;
22+ internalIndex : number ; //frameIndex inside the stack
2323 selected : boolean ;
2424 workspaceUri ?: vscode . Uri ;
2525 parameters : ParamStats [ ] ;
@@ -132,7 +132,7 @@ export class ErrorFlowStackRenderer {
132132 private getAffectedPathSectionHtml ( )
133133 {
134134 const errorService = this . _viewModel ?. summary ?. serviceName ?? '' ;
135- const errorSpanNames = this . _viewModel ?. stacks . flatMap ( s => s . frames ) . filter ( f => f . stackIndex == 0 ) . map ( f => f . spanName ) ?? [ ] ;
135+ const errorSpanNames = this . _viewModel ?. stacks . flatMap ( s => s . frames ) . filter ( f => f . internalIndex == 0 ) . map ( f => f . spanName ) ?? [ ] ;
136136
137137 function getTree ( affectedPath : AffectedPathViewModel , level : any ) : string
138138 {
@@ -241,12 +241,9 @@ export class ErrorFlowStackRenderer {
241241 for ( const frame of frames ) {
242242 if ( frame . spanName !== lastSpan ) {
243243 stackHtml += `
244- <div style="color: #4F62AD;" class="list ellipsis">
245- <span>
246- <span>${ frame . spanName } </span>
247- <span style="color:#4F62AD;line-height:25px;margin-right:5px" class="codicon codicon-telescope">
248- </span>
249- </span>
244+ <div class="frame-span">
245+ <span class="codicon codicon-telescope" title="OpenTelemetry"></span>
246+ <span class="left-ellipsis" title="${ frame . spanName } ">${ frame . spanName } </span>
250247 </div>` ;
251248
252249 lastSpan = frame . spanName ;
@@ -272,22 +269,32 @@ export class ErrorFlowStackRenderer {
272269 const selectedClass = frame . selected ? "selected" : "" ;
273270 const disabledClass = frame . workspaceUri ? "" : "disabled" ;
274271 const hidden = Settings . hideFramesOutsideWorkspace . value && ! frame . workspaceUri ? "hidden" : "" ;
275-
276- let exception_html = '<span style="color:#f14c4c;line-height:25px;margin-right:5px" class="codicon codicon-symbol-event"> </span>' ;
277-
278- let linkTag = frame . workspaceUri
272+ const showExceptionIcon = frame . internalIndex === 0 ;
273+ let exceptionHtml = '<span style="color:#f14c4c;margin-right:5px" class="codicon codicon-symbol-event"> </span>' ;
274+ let executedCodeHtml = '' ;
275+ if ( frame . executedCode ) {
276+ executedCodeHtml = frame . workspaceUri
279277 ? /*html*/ `<vscode-link class="link-cell" data-frame-id="${ frame . id } " title="${ frame . executedCode } ">${ frame . executedCode } </vscode-link>`
280278 : /*html*/ `<span class="link-cell look-like-link" title="${ frame . executedCode } ">${ frame . executedCode } </span>` ;
281-
282- if ( frame . stackIndex === 0 ) {
283- linkTag = exception_html + linkTag ;
279+ if ( showExceptionIcon ) {
280+ executedCodeHtml = exceptionHtml + executedCodeHtml ;
281+ }
282+ }
283+ let pathHtml = `<div class="left-ellipsis" title="${ path } ">${ path } </div>` ;
284+ if ( executedCodeHtml === '' ) {
285+ if ( frame . workspaceUri ) {
286+ pathHtml = /*html*/ `<vscode-link class="link-cell" data-frame-id="${ frame . id } " title="${ path } ">${ path } </vscode-link>` ;
287+ }
288+ if ( showExceptionIcon ) {
289+ pathHtml = `<div class="frame-code-path">${ exceptionHtml } ${ pathHtml } </div>` ;
290+ }
284291 }
285292 return /*html*/ `
286293 <li class="${ frame . workspaceUri ?'inside-workspace' :'outside-workspace' } " ${ hidden } >
287294 <div class="line ${ selectedClass } ${ disabledClass } ">
288- <div class="left-ellipsis" title=" ${ path } "> ${ path } </div>
295+ ${ pathHtml }
289296 <div class="bottom-line">
290- ${ linkTag }
297+ ${ executedCodeHtml }
291298 <div class="number-cell">line ${ frame . lineNumber } </div>
292299 </div>
293300 </div>
0 commit comments