ms-jpq / coq_nvim

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.
GNU General Public License v3.0
3.47k stars 96 forks source link

How to complete rust? #524

Open lucasjinreal opened 1 year ago

lucasjinreal commented 1 year ago

Hi, I have installed coq, and also COQdeps installed requirements.

But currently, it can only promot on buffer (exited chars in doc), but can not promot functions, modules, keywords in rust.

image

How can I make it fully completion?

Same on python scripts:

image
EnricoSteez commented 1 year ago

Hi, did you solve this at all? I am struggling to setup python LSP as well, there seems to be no instructions on how to configure it

zArubaru commented 1 year ago

@jinfagang @EnricoSteez

You need the appropriate LSP (Language Server Protocol) installed.

For example, I use nvim and nvim-lspconfig for most of my LSP needs. My editor is not currently configured for Python, but you should find a suitable option under Configs, rust_analyzer for rust. (You will need to install the LSP yourself, or find a suitable auto-installer, either way is pretty straightforward).

If you're not using nvim there should be similar solutions for vim, it's been a while since I used vanilla vim actively, so don't know what the current goto is!

Hopefully that pushes you in the right direction 🙏 nvim-lspconfig requires a bit of configuration, but I believe in you!

Also mentioned in COQ docs

EnricoSteez commented 1 year ago

@zArubaru I have pyright set up and working, I even used git_ancestor so that it picks ups the correct project root dir. When I run :LspInfo, everything is working correctly. But still, coq does not show the completions from pyright, only from other sources such as TMUX, current BUF and SNIPpets

BugLight commented 1 year ago

Any updates here? Rust LSP completions does not show up in the completion list. However python with pyright lsp server works fine. If there is someone who uses COQ with Rust, please, share the configuration 🙏

wiebecommajonas commented 9 months ago

I solved this by setting vim.g.coq_settings = { limits = { completion_auto_timeout = 0.2 } }, because it seemed like the rust LSP could not catch up with the refresh rate of coq_nvim.

Docs