mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
Fix quoted idents in ctags (#24317)
Running `ctags` on files with quoted symbols (e.g. `$`) would list \` instead of the full ident. Issue was the result getting reassigned at the end to a \` instead of appending
This commit is contained in:
@@ -830,7 +830,7 @@ proc getName(n: PNode): string =
|
||||
of nkAccQuoted:
|
||||
result = "`"
|
||||
for i in 0..<n.len: result.add(getName(n[i]))
|
||||
result = "`"
|
||||
result.add('`')
|
||||
of nkOpenSymChoice, nkClosedSymChoice, nkOpenSym:
|
||||
result = getName(n[0])
|
||||
else:
|
||||
|
||||
16
tests/tools/tctags.nim
Normal file
16
tests/tools/tctags.nim
Normal file
@@ -0,0 +1,16 @@
|
||||
discard """
|
||||
cmd: '''nim ctags --stdout $file'''
|
||||
nimout: '''
|
||||
Foo
|
||||
hello
|
||||
`$$`
|
||||
'''
|
||||
action: "compile"
|
||||
"""
|
||||
|
||||
type
|
||||
Foo = object
|
||||
|
||||
proc hello() = discard
|
||||
|
||||
proc `$`(x: Foo): string = "foo"
|
||||
Reference in New Issue
Block a user