@@ -78,7 +78,6 @@ type # please make sure we have under 32 options
7878 optWholeProject # for 'doc': output any dependency
7979 optDocInternal # generate documentation for non-exported symbols
8080 optMixedMode # true if some module triggered C++ codegen
81- optListFullPaths # use full paths in toMsgFilename
8281 optDeclaredLocs # show declaration locations in messages
8382 optNoNimblePath
8483 optHotCodeReloading
@@ -258,6 +257,14 @@ type
258257 stdOrrStdout
259258 stdOrrStderr
260259
260+ FilenameOption * = enum
261+ foAbs # absolute path, e.g.: /pathto/bar/foo.nim
262+ foRelProject # relative to project path, e.g.: ../foo.nim
263+ foCanonical # canonical module name
264+ foMagicSauce # magic sauce, shortest of (foAbs, foRelProject)
265+ foName # lastPathPart, e.g.: foo.nim
266+ foStacktrace # if optExcessiveStackTrace: foAbs else: foName
267+
261268 ConfigRef * = ref object # # every global configuration
262269 # # fields marked with '*' are subject to
263270 # # the incremental compilation mechanisms
270277 macrosToExpand* : StringTableRef
271278 arcToExpand* : StringTableRef
272279 m* : MsgConfig
280+ filenameOption* : FilenameOption # how to render paths in compiler messages
273281 evalTemplateCounter* : int
274282 evalMacroCounter* : int
275283 exitcode* : int8
@@ -413,8 +421,7 @@ const
413421 optBoundsCheck, optOverflowCheck, optAssert, optWarns, optRefCheck,
414422 optHints, optStackTrace, optLineTrace, # consider adding `optStackTraceMsgs`
415423 optTrMacros, optStyleCheck, optCursorInference}
416- DefaultGlobalOptions * = {optThreadAnalysis,
417- optExcessiveStackTrace, optListFullPaths}
424+ DefaultGlobalOptions * = {optThreadAnalysis, optExcessiveStackTrace}
418425
419426proc getSrcTimestamp (): DateTime =
420427 try :
@@ -461,6 +468,7 @@ proc newConfigRef*(): ConfigRef =
461468 macrosToExpand: newStringTable (modeStyleInsensitive),
462469 arcToExpand: newStringTable (modeStyleInsensitive),
463470 m: initMsgConfig (),
471+ filenameOption: foAbs,
464472 cppDefines: initHashSet [string ](),
465473 headerFile: " " , features: {}, legacyFeatures: {}, foreignPackageNotes: foreignPackageNotesDefault,
466474 notes: NotesVerbosity [1 ], mainPackageNotes: NotesVerbosity [1 ],
@@ -514,6 +522,7 @@ proc newConfigRef*(): ConfigRef =
514522
515523proc newPartialConfigRef * (): ConfigRef =
516524 # # create a new ConfigRef that is only good enough for error reporting.
525+ # xxx FACTOR with `newConfigRef`
517526 when defined (nimDebugUtils):
518527 result = getConfigRef ()
519528 else :
@@ -522,6 +531,7 @@ proc newPartialConfigRef*(): ConfigRef =
522531 verbosity: 1 ,
523532 options: DefaultOptions ,
524533 globalOptions: DefaultGlobalOptions ,
534+ filenameOption: foAbs,
525535 foreignPackageNotes: foreignPackageNotesDefault,
526536 notes: NotesVerbosity [1 ], mainPackageNotes: NotesVerbosity [1 ])
527537
0 commit comments