SublimeText / CTags

CTags support for Sublime Text
MIT License
986 stars 167 forks source link

Fix matching of regex patterns lacking a right-anchor: #335

Closed zcutlip closed 1 year ago

zcutlip commented 5 years ago
stephenfin commented 5 years ago

I haven't touched this for quite some time and no longer use it myself, therefore I'm unable to test this :( I'd be willing to blindly merge it but how well tested is it?

zcutlip commented 5 years ago

Not terribly well tested. I tried it out on some fairly complex open source kernel code, but that's about it. Do you have a set of tests or some sort of testing process I can do?

stephenfin commented 5 years ago

Not particularly. There are some unit tests but I'm not sure how applicable they are. If you've been using this for some time, that's probably good enough testing

anatol commented 5 years ago

@zcutlip thank you for fixing the issue.

I see more things with C code and incorrect regexps. For example a bunch of functions in Linux tree are not properly CTagged. e.g. jumping to arch_local_irq_restore does not work. Looking at tags file I see

arch_local_irq_restore  arch/x86/include/asm/irqflags.h /^static inline notrace void arch_local_irq_restore(unsigned long flags)$/;"    f       typeref:typename:notrace void   signature:(unsigned long flags)
arch_local_irq_restore  arch/x86/include/asm/paravirt.h /^static inline notrace void arch_local_irq_restore(unsigned long f)$/;"        f       typeref:typename:notrace void   signature:(unsigned long f)
arch_local_irq_restore  include/asm-generic/irqflags.h  /^void arch_local_irq_restore(unsigned long flags);$/;" p       typeref:typename:void   signature:(unsigned long flags)

I wonder if parethesis in the regexp should be escaped. But as it is harder to change CTgas behavior maybe the plugin should workaround the pproblem?