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

Completion within strings

Open ibraheemdev opened this issue 4 years ago • 1 comments
trafficstars

paq 'nvim-lua/completion-nvim'

function on_attach(client, bufnr)
    require('completion').on_attach()
end

vim.o.completeopt = 'menuone,noselect'
vim.o.shortmess = o.shortmess .. 'c'

I'm running neovim 0.5 with the native LSP and rust-analyzer, and I am running into an issue where I am still getting autocomplete while typing withing double quoted strings. It seems to only occur within rust macro invocations:

2021-05-26_11-56

ibraheemdev avatar May 26 '21 15:05 ibraheemdev

@ibraheemdev if I understand you correctly, you do not want completion on strings? if so then perhaps you could do something like this?

local chain_complete_list = {
rust = {
  string = {},
  comment = {},
  default = {
    {complete_items = {'lsp', 'snippet'}},
    },
 }
}

local on_attach = function(client,buffer)
  require'completion'.on_attach({
      chain_complete_list = chain_complete_list,
    })

ranjithshegde avatar Jun 02 '21 10:06 ranjithshegde