completion-nvim icon indicating copy to clipboard operation
completion-nvim copied to clipboard

Plugin ignores file association

Open Dodje opened this issue 4 years ago • 4 comments

Hello. I have a lua file with extension (.ds), sadly completion seems to be not able to associate it with lua and show complete menu

init.vim
...
autocmd BufRead,BufNewFile *.ds set filetype=lua
lua require'nvim_lsp'.sumneko_lua.setup{on_attach=require'completion'.on_attach}

echo &filetype returns 'lua'

Dodje avatar Oct 14 '20 11:10 Dodje

Can you see if you can setup omnifunc completion and use that in the .ds file? I've done some testing on my side and find out completion-nvim seems to be attached but the server is not responding.

haorenW1025 avatar Oct 14 '20 18:10 haorenW1025

If I'm not mistaken, wrote this to enable

filetype plugin on
set omnifunc=syntaxcomplete#Complete

and CTRL-X CTRL-O shows

ds-file-with-omnifunc

Dodje avatar Oct 15 '20 08:10 Dodje

Ahh that is not coming from lsp. You have to set

au Filetype lua    setl omnifunc=v:lua.vim.lsp.omnifunc

haorenW1025 avatar Oct 15 '20 09:10 haorenW1025

Here is the result: without complete-popup-without-omnifunc and

with complete-popup-with-omnifunc

I also tried to work with lsp and set up some config, where I put paths from :LspInstallInfo and added ds file into filetypes property

Dodje avatar Oct 15 '20 09:10 Dodje