rework tags (#24944)

recent ctags changes: https://github.com/nim-lang/Nim/pull/24317
ref https://forum.nim-lang.org/t/12879
This commit is contained in:
ringabout
2025-05-11 12:40:46 +08:00
committed by GitHub
parent 6f5e5811fc
commit 6c2f78a19f
2 changed files with 17 additions and 1 deletions

View File

@@ -1892,6 +1892,9 @@ proc commandJson*(cache: IdentCache, conf: ConfigRef) =
else:
#echo getOutFile(gProjectFull, JsonExt)
let filename = getOutFile(conf, RelativeFile conf.projectName, JsonExt)
conf.outFile = filename.relativeTo(conf.outDir)
let dir = filename.splitFile.dir
createDir(dir)
try:
writeFile(filename, content)
except IOError:
@@ -1912,8 +1915,10 @@ proc commandTags*(cache: IdentCache, conf: ConfigRef) =
if optStdout in d.conf.globalOptions:
write(stdout, content)
else:
#echo getOutFile(gProjectFull, TagsExt)
let filename = getOutFile(conf, RelativeFile conf.projectName, TagsExt)
conf.outFile = filename.relativeTo(conf.outDir)
let dir = filename.splitFile.dir
createDir(dir)
try:
writeFile(filename, content)
except IOError:

11
tests/tools/tctags2.nim Normal file
View File

@@ -0,0 +1,11 @@
discard """
cmd: '''nim ctags $file'''
action: "compile"
"""
type
Foo = object
proc hello() = discard
proc `$`(x: Foo): string = "foo"