Make C# scripts return correct error line and column numbers instead of failing because they have no linemap.
Adapted fix from http://opensimulator.org/mantis/view.php?id=6571 Thanks Nickel Briand0.7.4-extended
parent
85a327dc59
commit
7af13bcca3
|
@ -660,13 +660,18 @@ namespace SecondLife
|
||||||
{
|
{
|
||||||
string severity = CompErr.IsWarning ? "Warning" : "Error";
|
string severity = CompErr.IsWarning ? "Warning" : "Error";
|
||||||
|
|
||||||
KeyValuePair<int, int> lslPos;
|
KeyValuePair<int, int> errorPos;
|
||||||
|
|
||||||
// Show 5 errors max, but check entire list for errors
|
// Show 5 errors max, but check entire list for errors
|
||||||
|
|
||||||
if (severity == "Error")
|
if (severity == "Error")
|
||||||
{
|
{
|
||||||
lslPos = FindErrorPosition(CompErr.Line, CompErr.Column, m_lineMaps[assembly]);
|
// C# scripts will not have a linemap since theres no line translation involved.
|
||||||
|
if (!m_lineMaps.ContainsKey(assembly))
|
||||||
|
errorPos = new KeyValuePair<int, int>(CompErr.Line, CompErr.Column);
|
||||||
|
else
|
||||||
|
errorPos = FindErrorPosition(CompErr.Line, CompErr.Column, m_lineMaps[assembly]);
|
||||||
|
|
||||||
string text = CompErr.ErrorText;
|
string text = CompErr.ErrorText;
|
||||||
|
|
||||||
// Use LSL type names
|
// Use LSL type names
|
||||||
|
@ -676,7 +681,7 @@ namespace SecondLife
|
||||||
// The Second Life viewer's script editor begins
|
// The Second Life viewer's script editor begins
|
||||||
// countingn lines and columns at 0, so we subtract 1.
|
// countingn lines and columns at 0, so we subtract 1.
|
||||||
errtext += String.Format("({0},{1}): {4} {2}: {3}\n",
|
errtext += String.Format("({0},{1}): {4} {2}: {3}\n",
|
||||||
lslPos.Key - 1, lslPos.Value - 1,
|
errorPos.Key - 1, errorPos.Value - 1,
|
||||||
CompErr.ErrorNumber, text, severity);
|
CompErr.ErrorNumber, text, severity);
|
||||||
hadErrors = true;
|
hadErrors = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue