-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion includes types of variables/methods #857
Comments
You probably want This ought to be the default behaviour, I think, indeed it likely shouldn't even be configurable. cf #856. |
Unfortunately, it's still broken even with this configuration option on 0.1.147. Maybe the option doesn't work properly? |
It works for me - with the caveat that it's more or less unusable! The way that this language client tries to implement prefer-text-edits is to accept the completion as specified by the server in the See Unfortunately this is not so good unless you break the undo sequence before starting the completion (see I guess you could remap (However if you're not seeing even that mess - I have no explanation). |
I can probably confirm it acts as you describe. If I enable the option and do the whole I guess I didn't go as far as to press the escape during the previous experiment, so I was still seeing the before-undo situation. In the ncm2 automatic mode this is even more unusable. There's no place I'd be pressing |
I dunno, I also use ncm2 with this plugin and it works just fine for me no matter what settings I use, with or without the proposed fix at #858. This makes no sense given what I think I know. |
OK, I'll try to dig into the ncm2 interaction a bit more once I get some time, to see if either the proposed PR fixes it for me or if I can pinpoint some kind of minimal config that acts weird. I can share my full config, but I guess you probably don't want to dig through that. |
I've managed to reproduce probably something even weirder with that branch. This is the config:
Now I open a new empty c file, eg When I do that with (freshly compiled) next branch from this repository, |
Not sure whether this is your problem or not, but you seem to have skipped some of the instructions from ncm2:
|
It seems to be related to the further weirdness allright (I do have this in my full config). So, testing now, with added this option, with the preferred textEdit and the linked branch, returning to the original example. When I type |
Well, beats me. As I say, it all works astonishingly well for me - https://asciinema.org/a/jk0WXxMbKJR8lHfrLrVIo9EBy. Feel free to dig through my config and see if you can figure out the difference, if you like - https://github.com/dimbleby/dotfiles/blob/master/.vimrc. But there's very little in there that's relevant to ncm2, so... |
This wasn't turned on by default is that my original implementation is too problematic and sometime unusable. |
There's one thing that I wonder if this might have an effect. What version of neovim do you use? I'm still on stable/0.3.7. |
I have basically the same setup as you described and I'm also experiencing the same issue. However I'm using the neovim master (6871445df), so this shouldn't be the source of the problem. |
I can confirm this issue, on Neovim 0.3.7 with Deoplete and Metals as my LanguageServer. Enabling |
Any word on this? This was not an issue a few months back for me. Is it the ccls? Or the client? or Deoplete? |
@MarkGreeny it must be an update of ccls that removed the "insertText" field, which LanguageClient-neovim depends to to create vim completion items, https://github.com/autozimu/LanguageClient-neovim/blob/next/src/types.rs#L536 "insertText" has been the older way for language server to return completion items and it is much easier and nicer to integrate to vim completion system. Unfortunately, the standard has been moving towards "textEdit", which in contrast is much harder to work with, https://microsoft.github.io/language-server-protocol/specification. Option |
@autozimu I run into the same issues with Metals, and the Right now I'm keeping LanguageClient-neovim pinned to the oldest version that still worked for me using |
Maybe this is the same thing as #813? I'm not 100% sure.
yes, commit
e4478a4789805c66ce24ae786677ae557cd411da
bin/languageclient --version
to get its version number.:checkhealth LanguageClient
?Yes
Describe the bug
I'm using ccls for the language client. The LanguageClient completes the code including types and parameters which don't actually belong to the code and need to be deleted.
It worked fine with 0.1.146 (only the relevant parts were added).
Environment
nvim --version
orvim --version
):git rev-parse --short HEAD
):e4478a4789805c66ce24ae786677ae557cd411da
bin/languageclient --version
):languageclient 0.1.147
reproduce the issue. Refer to an example [here][min-vimrc.vim]):
(but it seems not to depend on the version)
To Reproduce
Have this C file:
Then add new line,
point.
and press Ctrl+X,Ctrl+O to trigger completion (my full setup uses ncm2, so I get the completions open automatically, but the minimal one needs manual trigger).It is completed to line:
point.x : int
. The: int
obviously doesn't belong to the program code and I have to go and delete it, which rather slows things down. Similar thing happens for method/function parameters, etc.Expected behavior
Only the
x
is completed.Additional context
I'm going to attach the logs.
The text was updated successfully, but these errors were encountered: