mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
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:
@@ -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
11
tests/tools/tctags2.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
discard """
|
||||
cmd: '''nim ctags $file'''
|
||||
action: "compile"
|
||||
"""
|
||||
|
||||
type
|
||||
Foo = object
|
||||
|
||||
proc hello() = discard
|
||||
|
||||
proc `$`(x: Foo): string = "foo"
|
||||
Reference in New Issue
Block a user