Skip to content

Commit

Permalink
Merge pull request #430 from lukecotter/bug-call-tree-debug-text-not-…
Browse files Browse the repository at this point in the history
…shown

bug: call tree debug text not shown
  • Loading branch information
lcottercertinia authored Oct 26, 2023
2 parents cbc4a61 + 21c3568 commit 3d322e1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.10.1] - 2023-10-26

### Fixed

- Call Tree not showing `USER_DEBUG` content ([#429][#429])

## [1.10.0] - 2023-10-19

### Added
Expand Down Expand Up @@ -260,6 +266,10 @@ Skipped due to adopting odd numbering for pre releases and even number for relea
- Add explorer menu item
- Provide more information when selecting log to download

<!-- v1.10.1 -->

[#429]: https://github.com/certinia/debug-log-analyzer/issues/429

<!-- v1.10.0 -->

[#279]: https://github.com/certinia/debug-log-analyzer/issues/279
Expand Down
2 changes: 1 addition & 1 deletion lana/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lana",
"displayName": "Apex Log Analyzer",
"version": "1.10.0",
"version": "1.10.1",
"description": "Analyzer for Salesforce debug logs - Visualize code execution via a Flame graph and identify performance and SOQL/DML problems via Method and Database analysis",
"keywords": [
"apex",
Expand Down
21 changes: 11 additions & 10 deletions log-viewer/modules/calltree-view/CalltreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export async function renderCallTree(

const selfTimeFilterCache = new Map<string, boolean>();
const totalTimeFilterCache = new Map<string, boolean>();
let childIndent;
calltreeTable = new Tabulator(callTreeTableContainer, {
data: toCallTree(rootMethod.children),
layout: 'fitColumns',
Expand Down Expand Up @@ -224,23 +225,23 @@ export async function renderCallTree(
const row = cell.getRow();
// @ts-expect-error: _row is private. This is temporary and I will patch the text wrap behaviour in the library.
const treeLevel = row._row.modules.dataTree.index;
const indent = row.getTable().options.dataTreeChildIndent || 0;
const levelIndent = treeLevel * indent;
childIndent ??= row.getTable().options.dataTreeChildIndent || 0;
const levelIndent = treeLevel * childIndent;
cellElem.style.paddingLeft = `${levelIndent + 4}px`;
cellElem.style.textIndent = `-${levelIndent}px`;

const node = (cell.getData() as CalltreeRow).originalData;
const text = node.text + (node.lineNumber ? `:${node.lineNumber}` : '');
let text = node.text;
if (node.hasValidSymbols) {
const logLineBody = document.createElement('a');
logLineBody.href = '#';
logLineBody.textContent = text;
return logLineBody;
text += node.lineNumber ? `:${node.lineNumber}` : '';
return `<a href="#!">${text}</a>`;
}

const textWrapper = document.createElement('span');
textWrapper.appendChild(document.createTextNode(text));
return textWrapper;
const excludedTypes = ['SOQL_EXECUTE_BEGIN', 'DML_BEGIN'];
text =
(!excludedTypes.includes(node.type) && node.type !== text ? node.type + ': ' : '') +
text;
return text;
},
variableHeight: true,
cellClick: (e, cell) => {
Expand Down
47 changes: 18 additions & 29 deletions log-viewer/modules/parsers/TreeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -847,15 +847,7 @@ class VariableScopeBeginLine extends LogLine {
constructor(parts: string[]) {
super(parts);
this.lineNumber = parseLineNumber(parts[2]);
this.text = parts[3];
this.value = parts[4];
}

onEnd(end: LogLine, _stack: LogLine[]): void {
if (end.value) {
this.value = end.value;
}
console.debug('NEVER HIT?');
this.text = parts.slice(3).join(' | ');
}
}

Expand All @@ -868,15 +860,14 @@ class VariableAssignmentLine extends LogLine {
constructor(parts: string[]) {
super(parts);
this.lineNumber = parseLineNumber(parts[2]);
this.text = parts[3];
this.value = parts[4];
this.text = parts.slice(3).join(' | ');
}
}
class UserInfoLine extends LogLine {
constructor(parts: string[]) {
super(parts);
this.lineNumber = parseLineNumber(parts[2]);
this.text = this.type + ':' + parts[3] + ' ' + parts[4];
this.text = parts[3] + ' ' + parts[4];
}
}

Expand All @@ -886,8 +877,7 @@ class UserDebugLine extends LogLine {
constructor(parts: string[]) {
super(parts);
this.lineNumber = parseLineNumber(parts[2]);
this.text = parts[3];
this.value = parts[4];
this.text = parts.slice(3).join(' | ');
}
}

Expand Down Expand Up @@ -958,52 +948,52 @@ class LimitUsageForNSLine extends LogLine {
class NBANodeBegin extends Method {
constructor(parts: string[]) {
super(parts, ['NBA_NODE_END'], 'systemMethod', 'method');
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}

class NBANodeDetail extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBANodeEnd extends LogLine {
isExit = true;
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBANodeError extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBAOfferInvalid extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBAStrategyBegin extends Method {
constructor(parts: string[]) {
super(parts, ['NBA_STRATEGY_END'], 'systemMethod', 'method');
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBAStrategyEnd extends LogLine {
isExit = true;
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}
class NBAStrategyError extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}

Expand Down Expand Up @@ -1128,8 +1118,7 @@ class EnteringManagedPackageLine extends Method {
const rawNs = parts[2],
lastDot = rawNs.lastIndexOf('.');

this.namespace = lastDot < 0 ? rawNs : rawNs.substring(lastDot + 1);
this.text = this.type + ' : ' + this.namespace;
this.text = this.namespace = lastDot < 0 ? rawNs : rawNs.substring(lastDot + 1);
}

onAfter(end?: LogLine): void {
Expand Down Expand Up @@ -1292,7 +1281,7 @@ class FlowElementBeginLine extends Method {

constructor(parts: string[]) {
super(parts, ['FLOW_ELEMENT_END'], 'flow', 'custom');
this.text = this.type + ' : ' + parts[3] + ' ' + parts[4];
this.text = parts[3] + ' ' + parts[4];
}
}

Expand Down Expand Up @@ -1441,7 +1430,7 @@ class FlowBulkElementBeginLine extends Method {

constructor(parts: string[]) {
super(parts, ['FLOW_BULK_ELEMENT_END'], 'flow', 'custom');
this.text = `${this.type} : ${parts[2]} - ${parts[3]}`;
this.text = `${parts[2]} - ${parts[3]}`;
}
}

Expand Down Expand Up @@ -1629,7 +1618,7 @@ class WFRuleEvalBeginLine extends Method {

constructor(parts: string[]) {
super(parts, ['WF_RULE_EVAL_END'], 'workflow', 'custom');
this.text = this.type + ' : ' + parts[2];
this.text = parts[2];
}
}

Expand Down Expand Up @@ -2002,7 +1991,7 @@ class BulkDMLEntry extends LogLine {
class DuplicateDetectionDetails extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}

Expand All @@ -2012,7 +2001,7 @@ class DuplicateDetectionDetails extends LogLine {
class DuplicateDetectionSummary extends LogLine {
constructor(parts: string[]) {
super(parts);
this.text = parts.slice(2, -1).join(' | ');
this.text = parts.slice(2).join(' | ');
}
}

Expand Down

0 comments on commit 3d322e1

Please sign in to comment.