Skip to content

Commit

Permalink
Enable locals completion for defmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Rudakov authored and bbatsov committed Jun 17, 2022
1 parent 069ae2c commit 55c3723
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### master (unreleased)

- [#84](https://github.com/alexander-yakushev/compliment/pull/84) Enable
locals completion for `defmethod` form

### 0.3.12 (2021-10-21)

- [#77](https://github.com/alexander-yakushev/compliment/issues/77): Add ability
Expand Down
2 changes: 1 addition & 1 deletion src/compliment/sources/local_bindings.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(def let-like-forms '#{let if-let when-let if-some when-some loop with-open
dotimes with-local-vars})

(def defn-like-forms '#{defn defn- fn defmacro})
(def defn-like-forms '#{defn defn- fn defmacro defmethod})

(def doseq-like-forms '#{doseq for})

Expand Down
7 changes: 6 additions & 1 deletion test/compliment/sources/t_local_bindings.clj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@
'(defn multiarg-fn "docstring"
([arg] (multiarg-fn arg nil))
([arg1 arg2] (do-stuff __prefix__))))))
=> (just ["multiarg-fn" "arg" "arg1" "arg2"] :in-any-order))
=> (just ["multiarg-fn" "arg" "arg1" "arg2"] :in-any-order)

(strip-tags (src/candidates "" *ns* (ctx/parse-context
'(defmethod multimethod "dispatch-val"
[foo bar & rest] __prefix__))))
=> (just ["multimethod" "foo" "bar" "rest"]))

(defmacro ^{:completion/locals :letfn} like-letfn [& _])
(fact "letfn is supported"
Expand Down

0 comments on commit 55c3723

Please sign in to comment.