hrsh7th / cmp-nvim-lsp

nvim-cmp source for neovim builtin LSP client
MIT License
1.29k stars 52 forks source link

`#` symbol doesn't start the cmp menu in a CSS property #57

Open sidequestboy opened 1 year ago

sidequestboy commented 1 year ago

I'm not 100% sure this is the right place to report this.

Using a minimal configuration nvim-minimal/init.vim:

if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit

lua << EOF
local cmp = require "cmp"
cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },

  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true })
  },

  sources = {
    { name = "nvim_lsp" },
  },
}

local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
local lspconfig = require('lspconfig')
lspconfig.cssls.setup {
  capabilities = capabilities
}
EOF

If I edit a css file with nvim -u nvim-minimal/init.vim style.css, and I'm writing hex colours, previously used colours show as suggestions in the cmp menu. However, I would expect the cmp menu to show up when I type #, but it doesn't:

Screenshot 2023-05-26 at 8 50 12 PM

If I begin writing the colour though, it shows up.

Screenshot 2023-05-26 at 8 50 18 PM

I would expect the # symbol to behave similarly to typing any other matchable character, for example a:

Screenshot 2023-05-26 at 8 58 25 PM
$ nvim --version
NVIM v0.9.0
Build type: Release
LuaJIT 2.1.0-beta3