Turn optPrintSurroundingSrc into hintSource
So surrounding source printing can be enabled for lower verbosity levels explicitly.
This commit is contained in:
parent
00366cb8d4
commit
d568ac3357
2 changed files with 9 additions and 7 deletions
|
|
@ -127,6 +127,7 @@ type
|
||||||
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
|
||||||
hintConditionAlwaysTrue, hintName, hintPattern,
|
hintConditionAlwaysTrue, hintName, hintPattern,
|
||||||
hintExecuting, hintLinking, hintDependency,
|
hintExecuting, hintLinking, hintDependency,
|
||||||
|
hintSource,
|
||||||
hintUser
|
hintUser
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -420,6 +421,7 @@ const
|
||||||
hintExecuting: "$1",
|
hintExecuting: "$1",
|
||||||
hintLinking: "",
|
hintLinking: "",
|
||||||
hintDependency: "$1",
|
hintDependency: "$1",
|
||||||
|
hintSource: "$1",
|
||||||
hintUser: "$1"]
|
hintUser: "$1"]
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -435,10 +437,11 @@ const
|
||||||
"ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
|
"ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
|
||||||
"GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
|
"GcMem", "Destructor", "LockLevel", "ResultShadowed", "User"]
|
||||||
|
|
||||||
HintsToStr*: array[0..19, string] = ["Success", "SuccessX", "LineTooLong",
|
HintsToStr*: array[0..20, string] = ["Success", "SuccessX", "LineTooLong",
|
||||||
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
"XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded",
|
||||||
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
"ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf",
|
||||||
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
|
"Path", "CondTrue", "Name", "Pattern", "Exec", "Link", "Dependency",
|
||||||
|
"Source",
|
||||||
"User"]
|
"User"]
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
@ -498,13 +501,15 @@ const
|
||||||
hintProcessing,
|
hintProcessing,
|
||||||
hintDependency,
|
hintDependency,
|
||||||
hintExecuting, hintLinking,
|
hintExecuting, hintLinking,
|
||||||
hintCodeBegin, hintCodeEnd},
|
hintCodeBegin, hintCodeEnd,
|
||||||
|
hintSource},
|
||||||
{low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
|
{low(TNoteKind)..high(TNoteKind)} - {warnShadowIdent, warnUninit,
|
||||||
warnProveField, warnProveIndex,
|
warnProveField, warnProveIndex,
|
||||||
warnGcUnsafe,
|
warnGcUnsafe,
|
||||||
hintDependency,
|
hintDependency,
|
||||||
hintExecuting,
|
hintExecuting,
|
||||||
hintCodeBegin, hintCodeEnd},
|
hintCodeBegin, hintCodeEnd,
|
||||||
|
hintSource},
|
||||||
{low(TNoteKind)..high(TNoteKind)},
|
{low(TNoteKind)..high(TNoteKind)},
|
||||||
{low(TNoteKind)..high(TNoteKind)}]
|
{low(TNoteKind)..high(TNoteKind)}]
|
||||||
|
|
||||||
|
|
@ -912,7 +917,7 @@ proc liMessage(info: TLineInfo, msg: TMsgKind, arg: string,
|
||||||
KindColor, `%`(KindFormat, kind))
|
KindColor, `%`(KindFormat, kind))
|
||||||
else:
|
else:
|
||||||
styledMsgWriteln(styleBright, x, resetStyle, color, title, resetStyle, s)
|
styledMsgWriteln(styleBright, x, resetStyle, color, title, resetStyle, s)
|
||||||
if optPrintSurroundingSrc and msg in errMin..errMax:
|
if msg in errMin..errMax and hintSource in gNotes:
|
||||||
info.writeSurroundingSrc
|
info.writeSurroundingSrc
|
||||||
handleError(msg, eh, s)
|
handleError(msg, eh, s)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,6 @@ template compilationCachePresent*: expr =
|
||||||
template optPreserveOrigSource*: expr =
|
template optPreserveOrigSource*: expr =
|
||||||
optEmbedOrigSrc in gGlobalOptions
|
optEmbedOrigSrc in gGlobalOptions
|
||||||
|
|
||||||
template optPrintSurroundingSrc*: expr =
|
|
||||||
gVerbosity >= 2
|
|
||||||
|
|
||||||
const
|
const
|
||||||
genSubDir* = "nimcache"
|
genSubDir* = "nimcache"
|
||||||
NimExt* = "nim"
|
NimExt* = "nim"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue