Open nskhei opened 2 years ago
NVIM v0.7.0
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-nvim-lsp' Plug 'neovim/nvim-lspconfig' Plug 'L3MON4D3/LuaSnip' Plug 'saadparwaiz1/cmp_luasnip' call plug#end() PlugInstall | quit " Setup global configuration. More on configuration below. lua << EOF local cmp = require "cmp" cmp.setup { snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end, }, mapping = { ['<CR>'] = cmp.mapping.confirm({ select = true }) }, sources = { { name = "nvim_lsp" }, }, } EOF lua << EOF local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) require'lspconfig'.tsserver.setup { capabilities = capabilities, } EOF
$
javascript
typescript
No response
It's language server's problem.
Thank you, I found this does not happen for denols.
denols
I also found that using UltiSnips for snippet.expand solves this problem as a workaround.
snippet.expand
FAQ
Issues
Neovim Version
NVIM v0.7.0
Minimal reproducible full config
Description
$
, it is not inserted to the buffer on confirm.$
.Steps to reproduce
javascript
ortypescript
file$
Expected behavior
Actual behavior
Additional context
No response