denops managed by dpp is not loaded with a state file created
kenji0923 opened this issue · 3 comments
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Problems summary
I configure that denops is managed by dpp. After an initial launch of vim, cache and state files are created with the former (cache.vim) including something about denops, but in the next launch of vim, in which dpp#min#load_state() returns 0, denops is not loaded. denops seems to be not cached in s:dpp_base/Vim/.dpp
. Thank you in advance, and for creating many highly flexible plugins.
Expected
denops is loaded by dpp with the cached state file.
Environment Information
-
dpp.vim version (SHA1): bf6f0d7
-
denops.vim version (SHA1): 16d4bbc5c8e359ab50042f66dc5c9a2cdeabff6e
-
deno version(
deno -V
output): deno 1.40.2 -
OS: macOS Ventura 13.6.3
-
neovim/Vim
:version
output:
- VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan 4 2024 03:08:50)
macOS 版 - x86_64
Compiled by GitHub Actions
Huge 版 with MacVim GUI. 機能の一覧 有効(+)/無効(-)
+acl +dialog_con_gui +jumplist +multi_byte +sodium +vertsplit
+arabic +diff +keymap +multi_lang +sound +vim9script
+autocmd +digraphs +lambda -mzscheme +spell +viminfo
+autochdir +dnd +langmap +netbeans_intg +startuptime +virtualedit
-autoservername -ebcdic +libcall +num64 +statusline +visual
+balloon_eval +emacs_tags +linebreak +odbeditor -sun_workshop +visualextra
+balloon_eval_term +eval +lispindent +packages +syntax +vreplace
+browse +ex_extra +listcmds +path_extra +tag_binary +wildignore
++builtin_terms +extra_search +localmap +perl/dyn -tag_old_static +wildmenu
+byte_offset -farsi +lua/dyn +persistent_undo -tag_any_white +windows
+channel +file_in_path +menu +popupwin -tcl +writebackup
+cindent +find_in_path +mksession +postscript +termguicolors -X11
+clientserver +float +modify_fname +printer +terminal -xattr
+clipboard +folding +mouse +profile +terminfo -xfontset
+cmdline_compl -footer +mouseshape +python/dyn +termresponse +xim
+cmdline_hist +fork() +mouse_dec +python3/dyn-stable +textobjects -xpm
+cmdline_info +fullscreen -mouse_gpm +quickfix +textprop -xsmp
+comments +gettext -mouse_jsbterm +reltime +timers -xterm_clipboard
+conceal -hangul_input +mouse_netterm +rightleft +title -xterm_save
+cryptv +iconv +mouse_sgr +ruby/dyn +toolbar
+cscope +insert_expand -mouse_sysmouse +scrollbind +transparency
+cursorbind +ipv6 +mouse_urxvt +signs +user_commands
+cursorshape +job +mouse_xterm +smartindent +vartabs
システム vimrc: "$VIM/vimrc"
ユーザー vimrc: "$HOME/.vimrc"
第2ユーザー vimrc: "~/.vim/vimrc"
ユーザー exrc: "$HOME/.exrc"
システム gvimrc: "$VIM/gvimrc"
ユーザー gvimrc: "$HOME/.gvimrc"
第2ユーザー gvimrc: "~/.vim/gvimrc"
デフォルトファイル: "$VIMRUNTIME/defaults.vim"
システムメニュー: "$VIMRUNTIME/menu.vim"
省略時の $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
コンパイル: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN
-g -O3 -flto -arch x86_64 -arch arm64 -I/usr/local/Cellar/libsodium/1.0.19/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SO
URCE=1 -Wall -Wextra -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations -Wno-error=missing-
field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-function
リンク: clang -arch x86_64 -arch arm64 -L/usr/local/lib -flto -o Vim -lm -lncurses /usr/local/lib/libsodium.a -liconv /usr/loca
l/lib/libintl.a -framework AppKit
Provide a minimal init.vim/vimrc without plugin managers (Required!)
" My minimal init.vim/vimrc
set nocompatible
" dpp
const s:dpp_config = '~/.config/vim/dpp.ts'
" Set dpp base path (required)
const s:dpp_base = '~/.cache/dpp/'
" Set dpp source path (required)
const s:denops_repo = 'vim-denops/denops.vim'
const s:dpp_repo = 'Shougo/dpp.vim'
const s:dpp_addon = [
\ 'Shougo/dpp-protocol-git',
\ 'Shougo/dpp-ext-toml'
\ ]
const s:dpp_manual_repo = [
\ s:denops_repo,
\ s:dpp_repo,
\ ]
const s:dpp_manual_repo_source_url = 'github.com/'
const s:denops_src = s:dpp_base . s:dpp_manual_repo_source_url . s:denops_repo
const s:dpp_src = s:dpp_base . s:dpp_manual_repo_source_url . s:dpp_repo
for repositry in (s:dpp_manual_repo + s:dpp_addon)
if ! isdirectory(s:dpp_base . s:dpp_manual_repo_source_url . repositry)
call mkdir(expand(s:dpp_base . s:dpp_manual_repo_source_url), "p")
call system('git clone https://' . s:dpp_manual_repo_source_url . repositry . ' ' . s:dpp_base . s:dpp_manual_repo_source_url . repositry)
endif
endfor
" Set dpp runtime path (required)
execute 'set runtimepath^=' .. s:dpp_src
for dpp_addon_path in s:dpp_addon
execute 'set runtimepath^=' .. s:dpp_base . s:dpp_manual_repo_source_url . dpp_addon_path
endfor
if s:dpp_base->dpp#min#load_state()
" NOTE: dpp#make_state() requires denops.vim
execute 'set runtimepath^=' .. s:denops_src
autocmd User DenopsReady call dpp#make_state(s:dpp_base, s:dpp_config)
endif
filetype indent plugin on
if has('syntax')
syntax on
endif
.config/vim/dpp.ts
import {
BaseConfig,
ContextBuilder,
Dpp,
Plugin,
} from "https://deno.land/x/dpp_vim@v0.0.9/types.ts";
import { Denops, fn } from "https://deno.land/x/dpp_vim@v0.0.9/deps.ts";
type Toml = {
hooks_file?: string;
ftplugins?: Record<string, string>;
plugins: Plugin[];
};
type LazyMakeStateResult = {
plugins: Plugin[];
stateLines: string[];
};
export class Config extends BaseConfig {
override async config(args: {
denops: Denops;
contextBuilder: ContextBuilder;
basePath: string;
dpp: Dpp;
}): Promise<{
plugins: Plugin[];
stateLines: string[];
}> {
args.contextBuilder.setGlobal({
protocols: ['git'],
});
const [context, options] = await args.contextBuilder.get(args.denops);
// Load toml plugins
const tomls: Toml[] = [];
tomls.push(
await args.dpp.extAction(
args.denops,
context,
options,
"toml",
"load",
{
path: "~/.config/vim/dpp_plugin.toml",
options: {
lazy: false,
},
},
) as Toml | undefined
);
// Merge toml results
const recordPlugins: Record<string, Plugin> = {};
const ftplugins: Record<string, string> = {};
const hooksFiles: string[] = [];
for (const toml of tomls) {
for (const plugin of toml.plugins) {
recordPlugins[plugin.name] = plugin;
}
if (toml.ftplugins) {
for (const filetype of Object.keys(toml.ftplugins)) {
if (ftplugins[filetype]) {
ftplugins[filetype] += `\n${toml.ftplugins[filetype]}`;
} else {
ftplugins[filetype] = toml.ftplugins[filetype];
}
}
}
if (toml.hooks_file) {
hooksFiles.push(toml.hooks_file);
}
}
return {
plugins: Object.values(recordPlugins),
stateLines: []
};
}
}
~/.config/vim/dpp_plugin.toml
[[plugins]]
repo="vim-denops/denops.vim"
Created cache.vim
[{"denops.vim":{"lazy":false,"repo":"vim-denops/denops.vim","name":"denops.vim","path":"/Users/kshu/.cache/dpp//repos/github.com/vim-denops/denops.vim","protocol":"git","sourced":false,"rtp":"/Users/kshu/.cache/dpp//repos/github.com/vim-denops/denops.vim","merged":true}},{},{"extOptions":{},"extParams":{},"hooksFileMarker":"{{{,}}}","inlineVimrcs":[],"protocolOptions":{},"protocolParams":{},"protocols":["git"]},[]]
Created state.vim
if g:dpp#_cache_version !=# 1| throw "Cache version error" | endif
let [g:dpp#_plugins, g:dpp#ftplugin, g:dpp#_options, g:dpp#_check_files] = g:dpp#_cache
let g:dpp#_config_path = '/Users/kshu/.config/vim/dpp.ts'
let &runtimepath = '/Users/kshu/.cache/dpp/github.com/Shougo/dpp-ext-toml,/Users/kshu/.cache/dpp/github.com/Shougo/dpp-protocol-git,/Users/kshu/.cache/dpp/github.com/Shougo/dpp.vim,/Users/kshu/.vim,/Applications/MacVim.app/Contents/Resources/vim/vimfiles,/Users/kshu/.cache/dpp/Vim/.dpp,/Applications/MacVim.app/Contents/Resources/vim/runtime,/Applications/MacVim.app/Contents/Resources/vim/vimfiles/after,/Users/kshu/.vim/after,/Users/kshu/.cache/dpp/Vim/.dpp/after'
Command result of find .dpp/
in .cache/Vim
.dpp/
.dpp//ftdetect
.dpp//doc
.dpp//after
.dpp//after/ftplugin.vim
How to reproduce the problem from neovim/Vim startup (Required!)
rm -rf .cache/dpp
vim
:q
vim
:call dpp#async_ext_action('', '')
Screenshot (if possible)
Upload the log messages by :redir
and :message
(if errored)
:messages
result
[dpp] denops.vim must be loaded before "dpp#async_ext_action()".
Plugins are not installed. You must install plugins by dpp-ext-installer
.
const s:dpp_manual_repo_source_url = 'github.com/'
This is wrong. Because manual installed plugins must be under repos
directory in the base directory.
Thank you for pointing out my setting failure. I should have noticed the path in the cache.vim, determined by the default setting, is different from the path I installed denops. Added documentation may help a lot.