ms-jpq / coq_nvim

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

Auto start not working #93

Closed heygarrett closed 3 years ago

heygarrett commented 3 years ago

My init.vim starts with this:

lua << EOF
require('plugins')

local nvim_lsp = require 'lspconfig'
local coq = require 'coq'

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

local servers = { 'pyright', 'rust_analyzer', 'sourcekit' }
for _, lsp in ipairs(servers) do
    nvim_lsp[lsp].setup(coq.lsp_ensure_capabilities({
        capabilities = capabilities
    }))
end
EOF

let g:coq_settings = { 'auto_start': v:true, 'keymap.jump_to_mark': '<c-n>' }

But coq does not auto start when launching neovim. But after doing :COQnow then <c-n> does work to jump between snippet markers.

If I run :echo g:coq_settings it returns {'keymap.jump_to_mark': '<c-n>', 'auto_start': v:true}

_Originally mentioned by @heygarrett in https://github.com/ms-jpq/coq_nvim/issues/65#issuecomment-901887602_

ms-jpq commented 3 years ago

oh you need to set coq_settings before require('coq').

its the one setting that cannot be auto loaded.

also you dont need this:

capabilities.textDocument.completion.completionItem.snippetSupport = true

what do you think lsp_ensure_capabilities is for :p

heygarrett commented 3 years ago

Oh, thank you! And I only have surface-level knowledge of vim after using it for 5+ years. 🙈 So sometimes getting plugins to work together feels like a jigsaw puzzle of sorts. But I appreciate your help! And thank you for such an amazing plugin. ❤️

copypasteonly commented 3 years ago

oh you need to set coq_settings before require('coq').

its the one setting that cannot be auto loaded.

also you dont need this:

capabilities.textDocument.completion.completionItem.snippetSupport = true

what do you think lsp_ensure_capabilities is for :p

Complete beginner to neovim here, what do you mean by set coq_settings? I tried putting set coq_settings in my init file but it doesn't recognize it.

ms-jpq commented 3 years ago

can you paste your init file? thanks