Skip to content

Commit

Permalink
tagging: improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
avodonosov committed Jun 17, 2023
1 parent 7a61fd7 commit b93ac67
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions queries/tags.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Function Definitions ;;;;;;;;;;;;;;;;;;;;;;;

(defun_header
function_name: (sym_lit) @name) @definition.function

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Function Calls ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Basically, we consider every list literal with symbol as the
Expand Down Expand Up @@ -86,3 +90,26 @@
. (quoting_lit [(sym_lit) (package_lit)] @name)
(#match? @ignore "(?i)^(cl:)?make-instance$")
) @reference.class

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; TODO:
;; - Symbols referenced in defpackage
;;
;; (defpackage ...
;; (:export (symbol-a :symbol-b #:symbol-c "SYMBOL-D")))
;;
;; The goal is to allow quick navigation from the API
;; overview in the form of defpackage, to the definition
;; where user can read parameters, docstring, ect.
;; - The @name must not include the colon, or sharpsign colon, quotes,
;; just symbol-a, symbol-b, symbol-c, sybmol-d
;; - Downcase the names specified as stirng literals?
;; ("SYMBOL-D" -> symbol-d)
;; - We don't know if the exported symbol is a function, variable,
;; class or something else. The oficial doc
;; (https://tree-sitter.github.io/tree-sitter/code-navigation-systems)
;; does not even suggest a tag for variable reference.
;; (Although in practice, the `tree-sitter tags` command
;; allows any @reference.* and @definition.* tags)
;; Probably it's better to just use @reference.call for all
;; the symbols in the :export clause.

0 comments on commit b93ac67

Please sign in to comment.