Skip to content

Commit bee2800

Browse files
authored
Fix code and lines (#47)
* Fix code and lines * Bump 3.1.1
1 parent 4100928 commit bee2800

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Profiler/Profiler.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
RootModule = 'Profiler.psm1'
99

1010
# Version number of this module.
11-
ModuleVersion = '3.1.0'
11+
ModuleVersion = '3.1.1'
1212

1313
# Supported PSEditions
1414
# CompatiblePSEditions = @()

csharp/Profiler/Profiler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public static Dictionary<Guid, File> ProcessLines(List<Hit> trace, Dictionary<Gu
9494
var contentMap = new Dictionary<Guid, string[]>();
9595
var returnIndexPerLineMap = new Dictionary<Guid, Dictionary<int, int>>();
9696
var traceCount = trace.Count;
97+
var newLineArray = new string[] { Environment.NewLine };
9798

9899
ScriptBlock lastScriptBlock = null;
99100
// excluding start and stop internal events
@@ -106,7 +107,7 @@ public static Dictionary<Guid, File> ProcessLines(List<Hit> trace, Dictionary<Gu
106107
{
107108
lastScriptBlock = scriptBlocks[key];
108109
// there is an edge case when using classes that will fail to convert to string
109-
try { lines = lastScriptBlock?.ToString().Split('\n'); } catch { lines = null; }
110+
try { lines = lastScriptBlock?.Ast.ToString().Split(newLineArray, StringSplitOptions.None); } catch { lines = null; }
110111
contentMap.Add(key, lines);
111112
}
112113

0 commit comments

Comments
 (0)