--filenames:abs|canonical|legacyRelProj for filenames in compiler msgs (replaces --listfullpaths:on|off)
#17746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
introduces
--filenames:abs|canonical|legacyRelProjfor filenames in compiler msgs (replaces--listfullpaths:on|offwhich is kept for backward compatibility)--filenames:abs is same as the old --listfullpaths:on
--filenames:legacyRelProj is the same as the old --listfullpaths:off
--filenames:canonical reuses the code from fix #16973 ; nim doc now shows correct, canonical import name in title #16999
--listfullpaths:off is now mapped to
--filenames:canonical(but i could change it to--filenames:legacyRelProjif needed)supersedes and closes [superseded] --listFullPaths:off now shows paths relative to cwd #13058, it'll be very easy to add
--filenames:relativeafter this PR if needed--filenames:canonicalis more context-independent, stable (independent of where nimble packages are installed) and less surprising than--filenames:legacyRelProjwhich was sometimes showing relative paths wrt main project name, sometimes show../in path, and sometimes show absolute pathsexample 1
--filenames:canonical
--filenames:legacyRelProj
=> as you can see the relative vs absolute paths with
--filenames:legacyRelProj(old--listfullpaths:off)are non-intuitiveexample 2
with a nimble package
nim r --filenames:canonical /pathto/tests/nim/all/t12177.nim
note
future work
declaredlocshas a minor bug: static (and typedesc and ...?) should be skipped:required type for s: static[string] [static declared in regex(290, 5)]
=>
required type for s: static[string] [string declared in system(34, 3)]
EDIT => PR
--declaredlocsnow shows location forTinstead ofstaticinproc fn(a: static T)#17795(pre-existing issue) honor
conf.filenameOptionfor--hint:msgorigin(right now hardcoded to absolute paths because oftoFileLineCol(InstantiationInfo)) (see also MsgOrigin doesn't honor listfullpaths:off timotheecour/Nim#463)maybe prefix nimble packages (other than one from main project file) with
pkg/for clarity