Skip to content

Commit

Permalink
Update ns_aliases in clj-kondo component to be able to specify from_ns
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Oct 9, 2020
1 parent 87137d8 commit e3dce4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autoload/iced/component/clj_kondo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ function! s:kondo.used_ns_list() abort
return s:L.uniq(result)
endfunction

function! s:kondo.ns_aliases() abort
function! s:kondo.ns_aliases(...) abort
let from_ns = get(a:, 1, '')
let usages = self.namespace_usages()
let result = {}
if empty(usages) | return result | endif
Expand All @@ -215,6 +216,10 @@ function! s:kondo.ns_aliases() abort
continue
endif

if !empty(from_ns) && usage['from'] !=# from_ns
continue
endif

" Format similar to refactor-nrepl's `namespace-aliases` op
let ns_list = get(result, alias_name, []) + [ns_name]
let result[alias_name] = s:L.uniq(ns_list)
Expand Down

0 comments on commit e3dce4a

Please sign in to comment.