Skip to content

Commit

Permalink
fix parsing for (def |foo bar|
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Sep 28, 2023
1 parent 4cc1659 commit cc7ba46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions extensions/lisp-mode/detective.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
(%default-capture 'lem/detective:package-reference position))

(defmethod capture-reference ((position lem:point) (class (eql :misc-reference)))
(let* ((line (str:split #\Space (line-string position)))
(type (str:replace-all "(" "" (first line)))
(name (remove #\) (second line))))
(ppcre:register-groups-bind (type name)
("^\\s*\\(\\s*(\\w+)\\s+(.*)\\s*" (line-string position))
(make-instance 'lem/detective:misc-reference
:misc-custom-type type
:reference-name name
:reference-name (string-right-trim '(#\space #\tab) name)
:reference-point position)))

0 comments on commit cc7ba46

Please sign in to comment.