nvim-lua / completion-nvim

A async completion framework aims to provide completion to neovim's built in LSP written in Lua
Apache License 2.0
973 stars 78 forks source link

Completion within strings #369

Open ibraheemdev opened 3 years ago

ibraheemdev commented 3 years ago
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

ranjithshegde commented 3 years ago

@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,
    })