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

Emmet-ls completion for sass/scss variables fails

Open 1256-bits opened this issue 1 year ago • 2 comments

FAQ

  • [X] I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

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/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"

require('mason').setup({})
require('mason-lspconfig').setup({
  ensure_installed = {'emmet_ls'},
  handlers = {
    function(server_name)
    require('lspconfig')[server_name].setup({})
      end,
    },
  })


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

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

  sources = cmp.config.sources({
    { name = "nvim_lsp" },
    { name = "buffer" },
  }),
}
EOF

lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()

require'lspconfig'.cssls.setup {
  capabilities = capabilities,
}
EOF


Description

Typing anything after the $ symbol in sass/scss files with emmet-ls active results in an error .../nvim-cmp/lua/cmp/utils/snippet.lua:409: snippet parsing failed The issue appeared after merging #1820, which is not a breaking change

Steps to reproduce

  1. nvim file.scss
  2. Type "$"

Expected behavior

Autocompletion window to pop up

Actual behavior

Error

Additional context

No response

1256-bits avatar Apr 25 '24 18:04 1256-bits

Having the same issue 😕

Roverp1 avatar Mar 17 '25 04:03 Roverp1

It started from hrsh7th/nvim-cmp@b7b2c12610e18810f95b3d87d673ce6e72ece916, going back to the previous commit removes the error

Roverp1 avatar Mar 17 '25 05:03 Roverp1