Skip to content

Commit

Permalink
- merging all relevant options
Browse files Browse the repository at this point in the history
  • Loading branch information
daslu committed Sep 10, 2024
1 parent 544f59a commit 8a2ffc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This change

## [1-beta8] - 2024-09-10
- updated Kindly to version 4-beta11 (deep-merge fix)
- merging all relevant options

## [1-beta7] - 2024-09-10
- updated Kindly to version 4-beta8 (moved options to ns form)
Expand Down
8 changes: 6 additions & 2 deletions src/scicloj/kindly_advice/v1/completion.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,21 @@
(:kindly/options m))
(when (var? x) (meta-options @x))))

(defn complete-options [{:keys [form]
(defn complete-options [{:keys [form value]
:as context}]
(let [form-options (meta-options form)]
;; Kindly options found on ns form cause options to be mutated
(when (and (sequential? form)
(-> form first (= 'ns))
form-options)
(kindly/merge-options! form-options))

(update context :kindly/options
(fn [context-options]
(kindly/deep-merge context-options (kindly/get-options))))))
(kindly/deep-merge context-options
(kindly/get-options)
(meta-options value)
form-options)))))

(defn complete [context]
(-> context
Expand Down

0 comments on commit 8a2ffc6

Please sign in to comment.