Skip to content

Commit 2165534

Browse files
authored
Merge pull request #202 from digma-ai/feature/js-various-fixes
Feature/js various fixes
2 parents 289450e + 3114bd3 commit 2165534

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/views/codeAnalytics/errorFlowStackRenderer.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,18 @@ export class ErrorFlowStackRenderer {
265265

266266
private static getFrameItemHtml(frame: FrameViewModel)
267267
{
268-
const path = `${frame.modulePhysicalPath} in ${frame.functionName}`;
268+
const pathParts = [];
269+
const modulePath = frame.modulePhysicalPath;
270+
if(modulePath) {
271+
pathParts.push(modulePath);
272+
}
273+
const functionName = frame.functionName?.trim();
274+
if(functionName.length > 0) {
275+
pathParts.push(functionName);
276+
}
277+
const path = pathParts.join(' in ');
278+
const pathTooltip = frame.workspaceUri?.fsPath ?? modulePath;
279+
269280
const selectedClass = frame.selected ? "selected" : "";
270281
const disabledClass = frame.workspaceUri ? "" : "disabled";
271282
const hidden = Settings.hideFramesOutsideWorkspace.value && !frame.workspaceUri ? "hidden" : "";
@@ -283,19 +294,23 @@ export class ErrorFlowStackRenderer {
283294
let pathHtml = `<div class="left-ellipsis" title="${path}">${path}</div>`;
284295
if(executedCodeHtml === ''){
285296
if(frame.workspaceUri){
286-
pathHtml = /*html*/`<vscode-link class="link-cell" data-frame-id="${frame.id}" title="${path}">${path}</vscode-link>`;
297+
pathHtml = /*html*/`<vscode-link class="link-cell" data-frame-id="${frame.id}" title="${pathTooltip}">${path}</vscode-link>`;
287298
}
288299
if (showExceptionIcon){
289300
pathHtml = `<div class="frame-code-path">${exceptionHtml}${pathHtml}</div>`;
290301
}
291302
}
303+
let lineNumberHtml = '';
304+
if(frame.lineNumber !== -1) {
305+
lineNumberHtml = `<div class="number-cell">line ${frame.lineNumber}</div>`;
306+
}
292307
return /*html*/`
293308
<li class="${frame.workspaceUri?'inside-workspace':'outside-workspace'}" ${hidden}>
294309
<div class="line ${selectedClass} ${disabledClass}">
295310
${pathHtml}
296311
<div class="bottom-line">
297312
${executedCodeHtml}
298-
<div class="number-cell">line ${frame.lineNumber}</div>
313+
${lineNumberHtml}
299314
</div>
300315
</div>
301316
</li>

0 commit comments

Comments
 (0)