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

Sumneko-lua showing out of context autocomplete selections #370

Open

Description

@McArdellje

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

Activity

  1. PascalZh commented on Sep 1, 2021

    @PascalZh

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions