Skip to content

Commit

Permalink
Add _mods.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Dec 6, 2023
1 parent 96532a7 commit d55edf9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:

- name: Check Type
run: |
echo "export const mods = {};" > denops/ddu/_mods.js
find denops -name "*.ts"| xargs deno test --unstable --no-run -A
- name: Check with deno lint
Expand All @@ -45,6 +44,5 @@ jobs:

- name: Test
run: |
echo "export const mods = {};" > denops/ddu/_mods.js
grep -rl Deno.test denops| xargs deno test --unstable -A
timeout-minutes: 5
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
denops/ddu/_mods.js
12 changes: 3 additions & 9 deletions autoload/ddu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,16 @@ function s:init() abort
return 1
endif

" Create default mods file.
const mods = [s:root_dir, 'denops', 'ddu', '_mods.js']->join(s:sep)
if !(mods->filereadable())
call writefile([
\ 'export const mods = {};',
\ ], mods)
endif

augroup ddu
autocmd!
autocmd User DenopsPluginPost:ddu let s:initialized = v:true
autocmd User Ddu:redraw :
augroup END

let g:ddu#_started = reltime()
let g:ddu#_mods = mods
if !('g:ddu#_mods'->exists())
const g:ddu#_mods = [s:root_dir, 'denops', 'ddu', '_mods.js']->join(s:sep)
endif

" NOTE: ddu.vim must be registered manually.

Expand Down
3 changes: 3 additions & 0 deletions denops/ddu/_mods.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// NOTE: It is dummy module. The file will be overwritten by
// "ddu#set_static_import_path()".
export const mods = {};

0 comments on commit d55edf9

Please sign in to comment.