Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Apr 19, 2021
1 parent 15f7c0f commit 44b1018
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 4 additions & 8 deletions compiler/msgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,10 @@ proc toFilenameOption*(conf: ConfigRef, fileIdx: FileIndex, opt: FilenameOption)
of foRelProject: result = toProjPath(conf, fileIdx)
of foMagicSauce:
let absPath = toFullPath(conf, fileIdx)
result = canonicalImport(conf, absPath.AbsoluteFile)
# relPath = toProjPath(conf, fileIdx)
# result = if (optListFullPaths in conf.globalOptions) or
# (relPath.len > absPath.len) or
# (relPath.count("..") > 2):
# absPath
# else:
# relPath
if optListFullPaths in conf.globalOptions:
result = absPath
else:
result = canonicalImportAux(conf, absPath.AbsoluteFile)
of foName: result = toProjPath(conf, fileIdx).lastPathPart
of foStacktrace:
if optExcessiveStackTrace in conf.globalOptions:
Expand Down
6 changes: 5 additions & 1 deletion compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ proc findProjectNimFile*(conf: ConfigRef; pkg: string): string =
if dir == "": break
return ""

proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
proc canonicalImportAux*(conf: ConfigRef, file: AbsoluteFile): string =
##[
Shows the canonical module import, e.g.:
system, std/tables, fusion/pointers, system/assertions, std/private/asciitables
Expand All @@ -898,6 +898,10 @@ proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
ret = relPath
if ret.isEmpty:
ret = relativeTo(file, conf.projectPath)
result = ret.string

proc canonicalImport*(conf: ConfigRef, file: AbsoluteFile): string =
let ret = canonicalImportAux(conf, file)
result = ret.string.nativeToUnixPath.changeFileExt("")

proc canonDynlibName(s: string): string =
Expand Down

0 comments on commit 44b1018

Please sign in to comment.