Comments (25)
May I ask how this issue was resolved? I'm currently experiencing a similar issue that's why. I am also using the latest node version as well.
from cmp-nvim-lsp.
Did you setup the below setting?
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- The following example advertise capabilities to `clangd`.
require'lspconfig'.clangd.setup {
capabilities = capabilities,
}```
from cmp-nvim-lsp.
@JensPauwels @nikbrunner I am guessing here, but it looks like you have an old version of Nodejs installed, which doesn't support the object?.key
syntax.
from cmp-nvim-lsp.
I'm experiencing the same as described by @nikbrunner
from cmp-nvim-lsp.
@JensPauwels @nikbrunner I am guessing here, but it looks like you have an old version of Nodejs installed, which doesn't support the
object?.key
syntax.
- For work I have to use
node 12.13.0
and I now switched for testing to just the latest version withnvm use node
which got me to17.2.0
- When I entered a project with
nvim
and navigated to a.css
file, I got this errorSpawning language server with cmd: "vscode-css-language-server" failed. The language server is either not installed, missing from PATH, or not executable
- I tried to re-install the
cssls
language server withlsp-installer
, but to no success - I ran manually
npm i -g vscode-langservers-extracted
and re-entered the file - Now it worked (See Screenshot)
- When I switch back to
node 12.13.0
and I re-enter, I get the errorClient 1 quit with exit code 1 and signal 0
, which is also reflected in the log file
:CmpStatus
with node 17.2.0
and manually installed language server
~/.cache/nvim/lsp.log
when entering file with node 12.13.0
[START][2021-12-27 14:24:56] LSP logging initiated
[START][2021-12-27 14:29:34] LSP logging initiated
[ERROR][2021-12-27 14:29:40] .../vim/lsp/rpc.lua:417 "rpc" "vscode-css-language-server" "stderr" "/Users/nibru/.nvm/versions/node/v12.13.0/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.nvm/versions/node/v12.13.0/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
[START][2021-12-27 14:30:26] LSP logging initiated
[START][2021-12-27 14:31:22] LSP logging initiated
[START][2021-12-27 14:32:47] LSP logging initiated
[ERROR][2021-12-27 14:32:56] .../vim/lsp/rpc.lua:417 "rpc" "vscode-css-language-server" "stderr" "/Users/nibru/.nvm/versions/node/v12.13.0/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.nvm/versions/node/v12.13.0/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
Conclusion
The node
version is definitely a problem, but I wonder if this prevents me from using neovim
for my work related projects where I have to use an older node
version
My Config
This are my config files
from cmp-nvim-lsp.
I'll try.
from cmp-nvim-lsp.
@JensPauwels I've published the v4.0.0.
from cmp-nvim-lsp.
Hi,
I want to add some notes for Ubuntu users.
Today I had a similar problem. But in my case, CSS and HTML completion doesn't work because of the 'snap' package Neovim on Ubuntu.
:cheсkhealth
showed something like this:
Failed to load parser: uv_dlopen: /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (requ
ired by /lib/x86_64-linux-gnu/libstdc++.so.6)
So I deleted 'snap' version, and install Neovim from github (because apt contain only neovim 0.4.0)
https://github.com/neovim/neovim/releases/nightly
Debian Package
Download
nvim-linux64.deb
Install the package usingsudo apt install ./nvim-linux64.deb
Run nvim
After that CSS and HTML completion works perfectly.
from cmp-nvim-lsp.
me too
from cmp-nvim-lsp.
I still have this problem. I even installed LunarVim and there exists the same problem for .css
files..
from cmp-nvim-lsp.
That is what I have. This also worked before and still works for ts
.
local nvim_lsp = require("lspconfig")
-- TODO Fix cssls completion
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
local servers = {
"html",
"cssls",
"tsserver"
}
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
capabilities = capabilities,
}
end
from cmp-nvim-lsp.
I can't understand... Hm...
I'm installed the cssls by npm i -g vscode-langservers-extracted@latest
.
from cmp-nvim-lsp.
I get this error message when I am entering an .scss
file for example.
But I am not sure if that has anything to do with it.
When I run :CmpStatus
I get this:
I will try your npm command and see if this causes a change
from cmp-nvim-lsp.
When I run the npm
command the Propblem remains.
The "Client 1 quit with exit code 1 and signal 0" error still occurs and I only get text-buffer completion.
from cmp-nvim-lsp.
I just noticed an error in ~/.cache/nvim/lsp.log
. This means that your plugin is probably working fine and it's due to the language server error
[ERROR][2021-12-15 09:14:31] .../vim/lsp/rpc.lua:417 "rpc" "vscode-css-language-server" "stderr" "/usr/local/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at wrapSafe (internal/modules/cjs/loader.js:915:16)\n at Module._compile (internal/modules/cjs/loader.js:963:27)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n at Module.load (internal/modules/cjs/loader.js:863:32)\n at Function.Module._load (internal/modules/cjs/loader.js:708:14)\n at Module.require (internal/modules/cjs/loader.js:887:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object. (/usr/local/lib/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:999:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)\n"
from cmp-nvim-lsp.
I have the same error in my ~/.cache/nvim/lsp.log
:
[ERROR][2021-12-15 08:44:43] .../vim/lsp/rpc.lua:417 "rpc" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/.bin/vscode-css-language-server" "stderr" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
[START][2021-12-15 08:44:58] LSP logging initiated
[ERROR][2021-12-15 08:45:00] .../vim/lsp/rpc.lua:417 "rpc" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/.bin/vscode-css-language-server" "stderr" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
[START][2021-12-15 08:45:13] LSP logging initiated
[ERROR][2021-12-15 08:45:15] .../vim/lsp/rpc.lua:417 "rpc" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/.bin/vscode-css-language-server" "stderr" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
[START][2021-12-15 08:48:28] LSP logging initiated
[ERROR][2021-12-15 08:48:30] .../vim/lsp/rpc.lua:417 "rpc" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/.bin/vscode-css-language-server" "stderr" "/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/linkedMap.js:40\n return this._head?.value;\n ^\n\nSyntaxError: Unexpected token '.'\n at Module._compile (internal/modules/cjs/loader.js:892:18)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n at Module.require (internal/modules/cjs/loader.js:849:19)\n at require (internal/modules/cjs/helpers.js:74:18)\n at Object.<anonymous> (/Users/nibru/.local/share/nvim/lsp_servers/cssls/node_modules/vscode-langservers-extracted/node_modules/vscode-jsonrpc/lib/common/api.js:37:21)\n at Module._compile (internal/modules/cjs/loader.js:956:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n at Module.load (internal/modules/cjs/loader.js:812:32)\n"
from cmp-nvim-lsp.
Is there any news on this issue?
from cmp-nvim-lsp.
I can't reproduce.
Kapture.2021-12-27.at.17.52.32.mp4
from cmp-nvim-lsp.
hrsh7th$ npm ls -g vscode-langservers-extracted
/Users/hiroshi_shichita/.config/nvm/versions/node/v16.13.0/lib
└── [email protected]
from cmp-nvim-lsp.
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").update_capabilities(capabilities)
local lspconfig = require('lspconfig')
lspconfig.cssls.setup {
capabilities = capabilities
}
EOF
from cmp-nvim-lsp.
https://github.com/JensPauwels/nvim/tree/cmp-upgrade This is a link to my nvim setup.
from cmp-nvim-lsp.
I don't know what happens if we use both of the lspconfig and lsp-installer.
In the first place, I say that even if I made the minimum configuration, it did not reproduce. Make the minimum configuration to reproduce.
from cmp-nvim-lsp.
I do indeed use node 12 for compatibility with older projects.
from cmp-nvim-lsp.
@hrsh7th Try lowering the target when building components of VSCode in vscode-langservers-extracted. I think, for their internal language servers it is defined in https://github.com/microsoft/vscode/blob/main/extensions/tsconfig.base.json.
from cmp-nvim-lsp.
I'm trying to transpile all modules via babel (/preset-env).
from cmp-nvim-lsp.
Related Issues (20)
- Filter some suggestions provided by cmp-nvim-lsp HOT 1
- Cause lags / delay with Telescope & UI
- Hide warning and error show on editor HOT 3
- LSP suggestions don't appear in certain files, although LS loaded
- migrate to Lazy.nvim and module 'cmp_nvim_lsp' not found HOT 1
- Filter out suggestion based on current typing characters HOT 1
- Error thrown when using omnicompletion HOT 1
- How to show "Auto import from ..." in the documentation window?
- Won't send more requests if **one** character no completions. HOT 7
- lsp completion items not updating unless I restart the server HOT 7
- `#` symbol doesn't start the cmp menu in a CSS property
- Option to exclude a client completely
- How to install cmp-nvim-lsp HOT 2
- Use of after directory, antipattern.
- entry_filter has no effect
- Confirmation behavior `Insert` does not work
- HTML & CSS LSP Autocompletion isn't working
- Can't stop suggestion box from closing when entering whitespace
- cmp_nvim_lsp not found HOT 3
- Disable JSX snippets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmp-nvim-lsp.