girishji / vimcomplete

Async autocompletion for Vim.
MIT License
111 stars 4 forks source link

Question about LSP keywordOnly option #58

Closed heavenshell closed 4 months ago

heavenshell commented 4 months ago

Hi, first of all, thank you for creating awesome plugin!

I have some question about LSP's keywordOnly option.

https://github.com/girishji/vimcomplete/blob/01bae49930c1081ecb583b855f8b12110a83bb0e/doc/vimcomplete.txt#L327-L330

According to the document, when keywordOnly option is false, LSP candidates popup after . typed. But It seemed to show LSP candidates regardless of keywordOnly option.

スクリーンショット 2024-05-12 10 41 47

When I type f and candidates popup and candidates are include LSP's candidates. I thought it didn't show LSP candidates until I hit the dot, but it does.

When the keywordOnly option is set to true, it works as documented. I would like to know the difference between the keywordOnly option. (Also I would like the LSP candidates to be displayed when I enter the dot)

Here is my settings.

const options = {
  lsp: {
      enable: true,
      keywordOnly: false,
    }
}
g:VimCompleteOptionsSet(options)

Thank you!

Shougo commented 4 months ago

I think the option works also keyword.

So keywordOnly option is false: keyword completion like f and dot completion.

girishji commented 4 months ago

It is working as expected. When keywordOnly is false it just lets LSP provide all possible completions. When true it prevents LSP from completing unless the prefix is a keyword -- so, it prevents completion after . or (, etc.

I don't remember the use case why this option was added. Maybe it should be removed to keep things simple.

heavenshell commented 4 months ago

@girishji Thank you for answer.

When true it prevents LSP from completing unless the prefix is a keyword -- so, it prevents completion after . or (, etc.

Now I understood. I thought this option is only enter .(or lsp's completionProvider's triggerCharacters) can popup candidates.

I don't remember the use case why this option was added. Maybe it should be removed to keep things simple.

Yeah, I think this is bit a confusing.