:imenu "Icon"
:namespace 'icon)
+(scope-define-symbol-type oclosure ()
+ :doc "oclosure type names."
+ :face 'font-lock-type-face
+ :help (lambda (beg end _def)
+ (if-let ((sym (intern (buffer-substring-no-properties beg end))))
+ (lambda (&rest _)
+ (if-let ((doc (oclosure--class-docstring (get sym 'cl--class))))
+ (format "OClosure type `%S'.\n\n%s" sym doc)
+ "OClosure type"))
+ "OClosure type"))
+ :completion (constantly (lambda (sym)
+ (oclosure--class-p (get sym 'cl--class))))
+ :namespace 'oclosure)
+
+(scope-define-symbol-type defoclosure ()
+ :doc "oclosure type definitions."
+ :face 'font-lock-type-face
+ :help (constantly "OClosure type definition")
+ :imenu "OClosure type"
+ :namespace 'oclosure)
+
(defvar scope-counter nil)
(defvar scope-local-functions nil)
(scope-define-function-analyzer defalias (sym _def &optional _docstring)
(when-let ((quoted (scope--unqoute sym))) (scope-report-s quoted 'defun)))
+(scope-define-function-analyzer oclosure--define
+ (&optional name _docstring parent-names _slots &rest props)
+ (when-let ((quoted (scope--unqoute name))) (scope-report-s quoted 'defoclosure))
+ (dolist (parent parent-names)
+ (when-let ((quoted (scope--unqoute parent))) (scope-report-s quoted 'oclosure)))
+ (while-let ((kw (car-safe props))
+ (bkw (scope-sym-bare kw))
+ ((keywordp bkw)))
+ (scope-report-s kw 'constant)
+ (case bkw
+ (:predicate
+ (when-let ((q (scope--unqoute (cadr props)))) (scope-report-s q 'defun))))
+ (setq props (cddr props))))
+
(scope-define-function-analyzer thing-at-point (thing &optional _)
(when-let ((quoted (scope--unqoute thing))) (scope-report-s quoted 'thing)))