deoplete-plugins / deoplete-lsp

LSP Completion source for deoplete

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fill the completed content input to the input line

LuoZhongYao opened this issue · comments

Problems summary

During the completion, the content of the completion list was filled into the input line without authorization, destroying the original input

Expected

Only display the list of possible completions, and the user can choose the completion options through ctrl+p/ctrl+n,

Environment Information

  • deoplete and deoplete-lsp version (SHA1):
    deoplete-lsp: commit fb51bfe
    deoplete: commit 51440bb8d9bc5e421d31d1a2a60a204468624e1b

  • OS: Linux localhost.localdomain 5.8.10-200.fc32.x86_64 #1 SMP Thu Sep 17 16:48:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  • neovim/Vim :version output:

NVIM v0.5.0-682-g997147e4b
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-f41aea03-0de7-498a-a604-70f79011fb59

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim
"

Run :checkhealth for more info

  • :checkhealth or :CheckHealth result(neovim only):

health#deoplete#check
========================================================================
## deoplete.nvim
  - OK: exists("v:t_list") was successful
  - OK: has("timers") was successful
  - OK: has("python3") was successful
  - OK: Require Python 3.6.1+ was successful
  - OK: Require msgpack 1.0.0+ was successful
  - INFO: If you're still having problems, try the following commands:
    - $ export NVIM_PYTHON_LOG_FILE=/tmp/log
    - $ export NVIM_PYTHON_LOG_LEVEL=DEBUG
    - $ nvim
    - $ cat /tmp/log_{PID}
    - and then create an issue on github

health#nvim_lsp#check
========================================================================
## Checking language server protocol configuration
  - INFO: cmake: configuration checked.
  - INFO: clangd: configuration checked.

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## 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~
  - INFO: $SSH_TTY='/dev/pts/0'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xsel

## 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.
          /usr/bin/python is Python 3.8 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.8.5
  - INFO: pynvim version: 0.4.2
  - OK: Latest pynvim is installed.

## 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


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

runtime! debian.vim

call plug#begin(stdpath('config') . '/plugged')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/deoplete-lsp'
Plug 'lifepillar/vim-solarized8'
Plug 'godlygeek/tabular'
Plug 'neovim/nvim-lspconfig'
call plug#end()

let g:deoplete#enable_at_startup = 1
" lua require'nvim_lsp'.bashls.setup{}
lua require'nvim_lsp'.cmake.setup{}
lua require'nvim_lsp'.clangd.setup{}

if (has("termguicolors"))
    set termguicolors
endif
set background=light
colorscheme solarized8

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

 nvim test.c
  1. Enter the following
struct Message {};

Continue typing me and it will automatically change to Me,

What is deoplete version?

Please read this.
Shougo/deoplete.nvim#1141

deoplete and deoplete-lsp version (SHA1): commit fb51bfe

You have uploaded deoplete-lsp version only.

deoplete和deoplete-lsp版本(SHA1):commit fb51bfe

您仅上传了deoplete-lsp版本。

commit 51440bb8d9bc5e421d31d1a2a60a204468624e1b

Really??

I have fixed the error...

I have tested it but I don't reproduce it.
Please upload the screenshot by asciinema.
https://asciinema.org/

Please test my minimal vimrc.

set rtp+=~/work/deoplete.nvim/
set rtp+=~/work/nvim-yarp
set rtp+=~/work/vim-hug-neovim-rpc
set rtp+=~/src/deoplete-lsp
set rtp+=~/src/nvim-lspconfig

let g:deoplete#enable_at_startup = 1

lua require'nvim_lsp'.rust_analyzer.setup{}
lua require'nvim_lsp'.cmake.setup{}
lua require'nvim_lsp'.clangd.setup{}

I will close the issue if other people cannot reproduce the problem.

@Shougo
Sorry, I thought the other options were irrelevant, so I didn't post it. In fact, I tested it. The following configuration will reproduce the problem

set rtp+=~/.config/nvim/plugged/deoplete.nvim/
set rtp+=~/.config/nvim/plugged/deoplete-lsp
set rtp+=~/.config/nvim/plugged/nvim-lspconfig

let g:deoplete#enable_at_startup = 1

lua require'nvim_lsp'.rust_analyzer.setup{}
lua require'nvim_lsp'.cmake.setup{}
lua require'nvim_lsp'.clangd.setup{}
set ignorecase smartcase
set completeopt=longest,menu

set ignorecase smartcase me will appear Message in the matching list,
while the option set completeopt = longest, menu will cause the input me to become Me

I cannot reproduce it...
Please check your deoplete is really the latest version.

Sorry, I thought the other options were irrelevant, so I didn't post it. In fact, I tested it. The following configuration will reproduce the problem

Please don't make the lie in the minimal vimrc. It confuses me.

I cannot reproduce it...
Please check your deoplete is really the latest version.

I cannot reproduce the problem. But I have added the hack feature for it.
Please use the latest of deoplete.

reproduced... Please upload the screencast in the first.

I have fixed the problem. Please update deoplete to the latest.

I have fixed the problem. Please update deoplete to the latest.

Fixed. I didn’t provide a screenshot because I couldn’t record it yet, thank you for the asciinema tool recommended

OK.