Skip to content

Commit c1686ac

Browse files
committed
👍 denops#plugin#check_type() shows 'no plugins are loaded' message
Fixes #406
1 parent 95f076b commit c1686ac

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

autoload/denops/plugin.vim

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,15 @@ endfunction
7777

7878
function! denops#plugin#check_type(...) abort
7979
if a:0
80-
let l:scripts = [denops#_internal#plugin#get(a:1).script]
80+
const l:plugins = [denops#_internal#plugin#get(a:1)]
8181
else
82-
let l:scripts = denops#_internal#plugin#list()
83-
\->copy()->map({ _, v -> v.script })->filter({ _, v -> v !=# '' })
82+
const l:plugins = denops#_internal#plugin#list()
83+
endif
84+
const l:scripts = l:plugins
85+
\->copy()->map({ _, v -> v.script })->filter({ _, v -> v !=# '' })
86+
if empty(l:scripts)
87+
call denops#_internal#echo#info("No plugins are loaded")
88+
return
8489
endif
8590
let l:args = [g:denops#deno, 'check'] + l:scripts
8691
let l:job = denops#_internal#job#start(l:args, {

doc/denops.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ denops#plugin#reload({plugin}[, {options}])
437437

438438
*denops#plugin#check_type()*
439439
denops#plugin#check_type([{name}])
440-
Runs Deno's type check feature for {name} or all registered plugins.
440+
Runs Deno's type check feature for {name} or all loaded plugins.
441441
The result of the check will be displayed in |message-history|. It
442442
throws an error when {name} does not match the |denops-plugin-name|.
443443

0 commit comments

Comments
 (0)