Skip to content

Commit

Permalink
Fix call to ns-groups when :filename-pattern in use
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic Monroe committed May 22, 2024
1 parent 8ac7b42 commit 452582d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- General
- Bump clj-kondo to `2024.05.22` fixing high memory usage issue.
- Fix use of `:filename-pattern` from kondo breaking references.

## 2024.04.22-11.50.26

Expand Down
4 changes: 2 additions & 2 deletions lib/src/clojure_lsp/feature/diagnostics.clj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
(defn ^:private unused-public-var->finding [element kondo-config]
(let [keyword-def? (identical? :keyword-definitions (:bucket element))
kondo-config (if (:ns element)
(kondo-config-for-ns kondo-config (:ns element) (:filename element))
(kondo-config-for-ns kondo-config (:ns element) (-> element :uri shared/uri->filename))
kondo-config)]
{:uri (:uri element)
:row (:name-row element)
Expand All @@ -59,7 +59,7 @@
:type :clojure-lsp/unused-public-var}))

(defn ^:private exclude-public-diagnostic-definition? [db kondo-config definition]
(let [kondo-config (kondo-config-for-ns kondo-config (:ns definition) (:filename definition))
(let [kondo-config (kondo-config-for-ns kondo-config (:ns definition) (-> definition :uri shared/uri->filename))
excluded-syms-regex (get-in kondo-config [:linters :clojure-lsp/unused-public-var :exclude-regex] #{})
excluded-defined-by-syms-regex (get-in kondo-config [:linters :clojure-lsp/unused-public-var :exclude-when-defined-by-regex] #{})
excluded-metas (get-in kondo-config [:linters :clojure-lsp/unused-public-var :exclude-when-contains-meta] #{})
Expand Down

0 comments on commit 452582d

Please sign in to comment.