Closed aartaka closed 2 weeks ago
Because tags should be unique and point to one location, while methods are (by definition) multiple locations. So, these should probably be ignored by the parser.
If you find such a description of tags in our documents, we must fix it. Please let me know if you find it.
ctags is not designed as you think. ctags should enumerate all definitions. ctags assumes dropping unwanted tags should be done on the side of client tools.
BTW Ideal ctags may add signature:
field like:
list-passwords libraries/password-manager/password-keepassxc.lisp /^(defmethod list-passwords ((password-interface keepassxc-interface))$/;" Y signature:((password-interface keepassxc-interface))
list-passwords libraries/password-manager/password-pass.lisp /^(defmethod list-passwords ((password-interface password-store-interface))$/;" Y signature:((password-interface password-store-interface))
list-passwords libraries/password-manager/password-security.lisp /^(defmethod list-passwords ((password-interface security-interface))$/;" Y signature:((password-interface security-interface))
Here is an example how to drop defmethod in a client tool:
$ cat /tmp/bar.lisp
(defgeneric X)
(defmethod X ((a)))
(defmethod X ((b)))
$ /bin/ctags -o - /tmp/bar.lisp
X /tmp/bar.lisp /^(defgeneric X)$/;" Y
X /tmp/bar.lisp /^(defmethod X ((a)))$/;" Y
X /tmp/bar.lisp /^(defmethod X ((b)))$/;" Y
$ /bin/ctags -o - /tmp/bar.lisp | readtags -et - -Q '(not (#/.*defmethod.*/ $pattern))' -l
X /tmp/bar.lisp /^(defgeneric X)$/;" kind:Y
If you think using a regular expression is awkward, I have a plan to add "deftype" lisp specific field to ctags. (I have a prototype implementation).
$ ~/bin//ctags --version=Lisp
parser/Lisp: 0.1
$ ~/bin/ctags -o - /tmp/bar.lisp
X /tmp/bar.lisp /^(defgeneric X)$/;" Y deftype:GENERIC
X /tmp/bar.lisp /^(defmethod X ((a)))$/;" Y deftype:METHOD
X /tmp/bar.lisp /^(defmethod X ((b)))$/;" Y deftype:METHOD
$ ~/bin//ctags -o - /tmp/bar.lisp | readtags -et - -Q '(not (eq? "METHOD" ($ "deftype")))' -l
X /tmp/bar.lisp /^(defgeneric X)$/;" kind:Y deftype:GENERIC
If you find such a description of tags in our documents, we must fix it. Please let me know if you find it.
No, it's okay. I was mostly using ex/vi docs for a reference, so they might've confused me, sorry.
The name of the parser: lisp
The command line you used to run ctags:
In the root dir of Nyxt browser
The tags output you are not satisfied with:
The tags output you expect:
Yes, empty output. Because tags should be unique and point to one location, while methods are (by definition) multiple locations. So these should probably be ignored by the parser.
The version of ctags:
How do you get ctags binary: via Arch pacman