nvim-lua / completion-nvim

A async completion framework aims to provide completion to neovim's built in LSP written in Lua
Apache License 2.0
973 stars 78 forks source link

cssls no autocompletion #264

Open abenz1267 opened 4 years ago

abenz1267 commented 4 years ago

My testing minimal init.vim Minimal config with with nvim-lspconfig, completion-nvim.

How to reproduce Create new *.css file and try out autocompletion

Expected behavior Autocompleting items. backg -> list with background- etc.

I've tried checking if it's nvim-lsp or something else, but autocompletion works fine with omnifunc.

Any idea?

Regards

Andrej Benz

haorenW1025 commented 4 years ago

That's weird...I'll look into this when I'm available.

Keating950 commented 4 years ago

I'm having a similar issue with all the LSP servers I've tried (rls, ccls, ocamllsp and pyls). I enable autocompletion like so:

autocmd BufEnter * lua require'completion'.on_attach()

Further down in my config, I enable various language servers:

lua <<EOF
    local lsp = require'lspconfig'
    local comp = require'completion'
    lsp.ccls.setup {
        settings = {
            diagnostics = {
                onChange = 4000;
            }
        }; 
        on_attach = comp.on_attach;
    }
    lsp.ocamllsp.setup{ on_attach = comp.on_attach; }
    lsp.rls.setup{ on_attach = comp.on_attach; }
    lsp.pyls.setup{ on_attach = comp.on_attach; }
EOF

But autocompletion doesn't work in buffers with the LSPs enabled, only in those without an LSP running.

gadkadosh commented 3 years ago

If this is still an issue for somebody, what helped me is set snippetSupport = true for cssls (and html). See: hrsh7th/vim-vsnip-integ#36

nimaipatel commented 3 years ago

Thank-you, I've been looking for a solution for so long for this. I feel like it needs to be more prominent somewhere in the documentation.