Skip to content

Commit 44b1018

Browse files
committed
fixup
1 parent 15f7c0f commit 44b1018

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler/msgs.nim

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,10 @@ proc toFilenameOption*(conf: ConfigRef, fileIdx: FileIndex, opt: FilenameOption)
254254
of foRelProject: result = toProjPath(conf, fileIdx)
255255
of foMagicSauce:
256256
let absPath = toFullPath(conf, fileIdx)
257-
result = canonicalImport(conf, absPath.AbsoluteFile)
258-
# relPath = toProjPath(conf, fileIdx)
259-
# result = if (optListFullPaths in conf.globalOptions) or
260-
# (relPath.len > absPath.len) or
261-
# (relPath.count("..") > 2):
262-
# absPath
263-
# else:
264-
# relPath
257+
if optListFullPaths in conf.globalOptions:
258+
result = absPath
259+
else:
260+
result = canonicalImportAux(conf, absPath.AbsoluteFile)
265261
of foName: result = toProjPath(conf, fileIdx).lastPathPart
266262
of foStacktrace:
267263
if optExcessiveStackTrace in conf.globalOptions:

compiler/options.nim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ proc findProjectNimFile*(conf: ConfigRef; pkg: string): string =
885885
if dir == "": break
886886
return ""
887887

888-
proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
888+
proc canonicalImportAux*(conf: ConfigRef, file: AbsoluteFile): string =
889889
##[
890890
Shows the canonical module import, e.g.:
891891
system, std/tables, fusion/pointers, system/assertions, std/private/asciitables
@@ -898,6 +898,10 @@ proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
898898
ret = relPath
899899
if ret.isEmpty:
900900
ret = relativeTo(file, conf.projectPath)
901+
result = ret.string
902+
903+
proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
904+
let ret = canonicalImportAux(conf, file)
901905
result = ret.string.nativeToUnixPath.changeFileExt("")
902906

903907
proc canonDynlibName(s: string): string =

0 commit comments

Comments
 (0)