Shougo / ddc.vim

Dark deno-powered completion framework for Vim/Neovim
MIT License
676 stars 32 forks source link

ddc.vim does not work in Perl scripts #45

Closed delphinus closed 3 years ago

delphinus commented 3 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Some (all?) sources cannot work in Perl scripts.

Expected

Want to work in Perl scripts.

Environment Information

NVIM v0.5.0
Build type: Debug
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvl
a -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=1 -I/root/neovim/build/config -I/root/neovim/src -I/root/neov
im/.deps/usr/include -I/usr/include -I/root/neovim/build/src/nvim/auto -I/root/neovim/build/include
Compiled by root@buildkitsandbox

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/root/local/nvim/share/nvim"
result ``` health#denops#check ======================================================================== - INFO: Supported Deno version: `1.11.0` - INFO: Detected Deno version: `1.13.2` - OK: Deno version check: passed - INFO: Supported Neovim version: `0.4.4` - INFO: Detected Neovim version: `0.5.0` - OK: Neovim version check: passed - INFO: Denops status: `running` - OK: Denops status check: passed health#nvim#check ======================================================================== ## Configuration - ERROR: Locale does not support UTF-8. Unicode characters may not display correctly. $LANG= $LC_ALL= $LC_CTYPE= - ADVICE: - If using tmux, try the -u option. - Ensure that your terminal/shell/tmux/etc inherits the environment, or set $LANG explicitly. - Configure your system locale. ## Performance - INFO: Build type: Debug - WARNING: Non-optimized (DEBUG) build. Nvim will be slower. - ADVICE: - Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`. - https://github.com/neovim/neovim/wiki/FAQ ## Remote Plugins - OK: Up to date ## terminal - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177 - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~ health#provider#check ======================================================================== ## Clipboard (optional) - WARNING: No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work. - ADVICE: - :help clipboard ## Python 2 provider (optional) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - ERROR: Python provider error: - ADVICE: - provider/pythonx: Could not load Python 2: python2 not found in search path or not executable. python2.7 not found in search path or not executable. python2.6 not found in search path or not executable. python not found in search path or not executable. - INFO: Executable: Not found ## Python 3 provider (optional) - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics. - ERROR: Python provider error: - ADVICE: - provider/pythonx: Could not load Python 3: python3 not found in search path or not executable. python3.10 not found in search path or not executable. python3.9 not found in search path or not executable. python3.8 not found in search path or not executable. python3.7 not found in search path or not executable. python3.6 not found in search path or not executable. python not found in search path or not executable. - INFO: Executable: Not found ## Python virtualenv - OK: no $VIRTUAL_ENV ## Ruby provider (optional) - WARNING: `ruby` and `gem` must be in $PATH. - ADVICE: - Install Ruby and verify that `ruby` and `gem` commands work. ## Node.js provider (optional) - WARNING: `node` and `npm` (or `yarn`) must be in $PATH. - ADVICE: - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work. ## Perl provider (optional) - ERROR: perl provider error: - ADVICE: - "Neovim::Ext" cpan module is not installed health#treesitter#check ======================================================================== ## Checking treesitter configuration - INFO: Runtime ABI version : 13 - OK: Loaded parser for c: ABI version 13 ```

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

call ddc#custom#patch_global({
      \ 'keywordPattern': '[a-zA-Z_]\w*',
      \ 'smartCase': v:true,
      \ 'sources': ['around'],
      \ 'sourceOptions': {
      \   '_': {'matchers': ['matcher_head']},
      \   'around': {'mark': 'A'},
      \ },
      \ })
call ddc#enable()

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Run Dockerfile
  2. nvim
  3. :e /tmp/hoge.sh
    • It show candidates validly.
  4. :e /tmp/hoge.pl
    • It shows none ;(

NOTE: This Dockerfile always fetches the latest repositories for plugins.

It shows ddc-around in config, but I experienced with several other sources. If you try, change init.vim as below.

diff ```diff --- /root/.config/nvim/init.vim.orig 2021-09-03 14:08:05.422130237 +0900 +++ /root/.config/nvim/init.vim 2021-09-03 14:08:15.948261303 +0900 @@ -1,10 +1,10 @@ call ddc#custom#patch_global({ \ 'keywordPattern': '[a-zA-Z_]\w*', \ 'smartCase': v:true, - \ 'sources': ['around'], + \ 'sources': ['look'], \ 'sourceOptions': { \ '_': {'matchers': ['matcher_head']}, - \ 'around': {'mark': 'A'}, + \ 'around': {'look': 'K'}, \ }, \ }) call ddc#enable() ```

Screenshot (if possible)

asciicast

Shougo commented 3 years ago

Reproduced for me. It is bug.

Shougo commented 3 years ago

Fixed.