autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

Redudant parenthesis with Rust Analyzer #1012

Closed ANtlord closed 4 years ago

ANtlord commented 4 years ago

Describe the bug

I use LanguageClient for Rust development. I switched from RLS to rust-analyzer. When I pick a method which expects arguments it inserts parenthesis and three points inside them.

Environment

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

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

- This plugin version (`git rev-parse --short HEAD`): `0.1.156 cf43a9feffeb479821dd3c6b6724ec7119c84bfa`
- This plugin's binary version (`bin/languageclient --version`): `0.1.156 cf43a9feffeb479821dd3c6b6724ec7119c84bfa`
- Minimal vimrc content: [min-vimrc.vim](https://github.com/ANtlord/langclient-test/blob/master/min-vimrc.nvim):

set termguicolors

call plug#begin('~/.local/share/nvim/plugged') Plug 'autozimu/LanguageClient-neovim', { \ 'branch': 'next', \ 'do': 'bash install.sh', \ } Plug 'https://github.com/cocopon/iceberg.vim/'

Plug 'ncm2/ncm2' Plug 'roxma/nvim-yarp' call plug#end() colorscheme iceberg let g:LanguageClient_serverCommands = { \ 'rust': ['rust-analyzer'], \ } autocmd BufEnter * call ncm2#enable_for_buffer() set completeopt=noinsert,menuone,noselect let g:LanguageClient_useVirtualText = 'No'


- Language server link and version:
https://github.com/rust-analyzer/rust-analyzer
Tested with two versions
    Commit: d075f49e6d342737c8eb81bd5448503bdc33bd79 (Release 2020-04-13)
    Commit: 7a59cd49ff2bb47fa0844fcf5f1ec44f32523b1b

## To Reproduce

Steps to reproduce the behavior:

- Fetch example project https://github.com/ANtlord/langclient-test
- Start vim, `nvim -u min-vimrc.vim`
- Insert `Ok` in the `main` function

## Current behavior

It inserts `Ok(…)`

## Expected behavior

It inserts `Ok`

## Screenshots

![Screenshot from 2020-04-18 22-54-41](https://user-images.githubusercontent.com/2972483/79669978-3fad8480-81c8-11ea-9924-7c3e7a4cb6d7.png)
jiahaowu commented 4 years ago

I also encountered this issue, which requires me to delete twice ( "...)" two redundant symbols) for each function completion that has arguments.

ANtlord commented 4 years ago

@jiahaowu did you try the new version of Rust Analyzer? Looks like it fixed from that side. At least for me

jiahaowu commented 4 years ago

@ANtlord Thanks for letting me know the change on the end of RA. I tried the new version of RA and the issue is resolved for me.

ANtlord commented 4 years ago

Ok, I think it can be closed.