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

Completion menu not poping up #403

Open
PolarianDev opened this issue Sep 29, 2021 · 4 comments
Open

Completion menu not poping up #403

PolarianDev opened this issue Sep 29, 2021 · 4 comments

Comments

@PolarianDev
Copy link

My init.vim

set relativenumber
set nu
set hidden
set incsearch
set scrolloff=6
set termguicolors
set shiftwidth=4
set tabstop=2
set softtabstop=2
syntax enable
set smartindent
set clipboard+=unnamedplus
filetype plugin indent on
set signcolumn=yes
set expandtab
set cursorline
set nowrap

set completeopt=menuone,noinsert,noselect
set shortmess+=c

call plug#begin('~/.vim/plugged')
Plug 'phanviet/vim-monokai-pro'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'
Plug 'preservim/nerdcommenter'
Plug 'preservim/nerdtree'
Plug 'OmniSharp/omnisharp-vim'
call plug#end()

colorscheme monokai_pro
highlight Normal guibg=none
highlight EndOfBuffer guibg=none

lua <<EOF

local nvim_lsp = require'lspconfig'
local pid = vim.fn.getpid()
local omnisharp_bin = "/usr/bin/omnisharp"
local attach_callback = require'completion'.on_attach

nvim_lsp.rust_analyzer.setup({ on_attach=attach_callback })
nvim_lsp.clangd.setup({ on_attach=attach_callback })
nvim_lsp.omnisharp.setup{
    cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) };
    on_attach=attach_callback
}
nvim_lsp.cmake.setup{ on_attach=attach_callback }

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
  vim.lsp.diagnostic.on_publish_diagnostics, {
    virtual_text = true,
    signs = true,
    update_in_insert = true,
  }
)
EOF

" ====== KEYBINDS ======
let mapleader = " "

" lsp
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> <leader>h <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> <leader>r <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> <leader>d <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> <leader>a <cmd>lua vim.lsp.buf.code_action()<CR>
nnoremap <silent> <leader>[ <cmd>lua vim.lsp.diagnostic.goto_prev()<CR>
nnoremap <silent> <leader>] <cmd>lua vim.lsp.diagnostic.goto_next()<CR>

" nerd commenter
nnoremap <silent> <leader>cc <cmd>NERDCommenterComment<CR>
nnoremap <silent> <leader>cu <cmd>NERDCommenterUncomment<CR>

" nerd tree
nnoremap <silent> <leader>t <cmd>NERDTreeToggle<CR>

How to reproduce
Open A file and attempt to write code, I was working on my projects a few days ago and it was working fine, I come back after the latest neovim update to find nothing working. I have tested it and it is the version of neovim which is the issue, so I recommend if anyone else is having this issue please rollback your neovim version, if you are using arch linux like me, I advice adding it to the ignore packages to stop it upgrading.

I could not find out what was causing this issue, I checked the health and the health check was identical, I presume whatever API changes which were made in the latest neovim version must have impacted the menu being drawn to the terminal.

Expected behavior
The menu should automatically pop up while typing, I have not disabled it.

Versions
0.5.1 BROKEN
0.5.0 WORKING

@PolarianDev
Copy link
Author

PolarianDev commented Sep 29, 2021

I have realised that I have not explicitly stated the issue, the completion menu will not pop up when it is supposed to, I presume it is failing to draw to the terminal. Sorry for not being more clear

@sergekir
Copy link

#399 (comment) this solution helped me

@mrkz
Copy link

mrkz commented Sep 29, 2021

@sergekir I confirm that change also resolved this issue for me. looking forward to the fix 😃

EDIT:
Also, wouldn't this be a duplicate of #399 ?

@Shougo Shougo mentioned this issue Oct 6, 2021
@PolarianDev
Copy link
Author

I have yet found the time to check the solution outlined in #399 and #405 is a duplicate.

As for #399 it was not named extremely well for my search parameters and therefore I did not see it. When I get time I will take a look and see if that solution also works for me.

Thank you :)

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

3 participants