Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Sumneko-lua showing out of context autocomplete selections #370

Open
McArdellje opened this issue May 27, 2021 · 1 comment
Open

Sumneko-lua showing out of context autocomplete selections #370

McArdellje opened this issue May 27, 2021 · 1 comment

Comments

@McArdellje
Copy link

My testing minimal init.vim

" install plugins
call plug#begin('~/.vim/vimplug')
    Plug 'neovim/nvim-lspconfig'
    Plug 'nvim-lua/completion-nvim'
call plug#end()

" configure autocomplete
lua << EOF
require'lspconfig'.sumneko_lua.setup {
    cmd = {"/usr/bin/lua-language-server"},
    settings = {},
    on_attach=require'completion'.on_attach
}
EOF

How to reproduce
make a new lua file and type

local tbl = {key = "value"}

then (on a new line) type tbl. and look at the autocomplete suggestions

Expected behavior
one suggestion appears named key (like it does in the vscode extension that the language server is from)

Current behaviour
all variables and snippets appear even though they would be invalid in that context

@PascalZh
Copy link

PascalZh commented Sep 1, 2021

I also find another problem.
When g:completion_enable_server_trigger is set to 1, and auto popup is enabled (which is default), it will trigger auto pop up even on space, which is annoying.
I find sumneko-lua will provide '\n', '\t', ' ', ... as trigger characters. But in VSCode, it will not trigger auto popup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants