You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
When I open an Erlang file, I get the following error:
[coc.nvim] error: at Object.<anonymous> (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc-erlang_ls/lib/index.js:156:20)
:CocInfo shows the following error:
## versions
vim version: VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 25 2018 13:59:45)
node version: v13.5.0
coc.nvim version: 0.0.74-cd348f4905
term: dumb
platform: linux
## Messages
Messages maintainer: Bram Moolenaar <[email protected]>
[coc.nvim] error: UnhandledRejection: The "file" argument must be of type string. Received type object
[coc.nvim] error: TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
[coc.nvim] error: at validateString (internal/validators.js:118:11)
[coc.nvim] error: at normalizeSpawnArguments (child_process.js:405:3)
[coc.nvim] error: at spawn (child_process.js:545:13)
[coc.nvim] error: at Object.execFile (child_process.js:231:17)
[coc.nvim] error: at /home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc-erlang_ls/lib/index.js:102:25
[coc.nvim] error: at LanguageClient.createMessageTransports (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:54119:48)
[coc.nvim] error: at LanguageClient.createConnection (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56580:21)
[coc.nvim] error: at LanguageClient.resolveConnection (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56362:44)
[coc.nvim] error: at LanguageClient.start (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56299:14)
[coc.nvim] error: at Object.<anonymous> (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc-erlang_ls/lib/index.js:154:20)
## Output channel: coc-erlang
## Output channel: erlang_ls
[Error - 9:30:35 PM] Starting client failed:
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
at validateString (internal/validators.js:118:11)
at normalizeSpawnArguments (child_process.js:405:3)
at spawn (child_process.js:545:13)
at Object.execFile (child_process.js:231:17)
at /home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc-erlang_ls/lib/index.js:102:25
at LanguageClient.createMessageTransports (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:54119:48)
at LanguageClient.createConnection (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56580:21)
at LanguageClient.resolveConnection (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56362:44)
at LanguageClient.start (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc.nvim/build/index.js:56299:14)
at Object.<anonymous> (/home/hcs/d/cp/vim/vimfiles/pack/dixon-plugins/opt/coc-erlang_ls/lib/index.js:154:20)
The possible reason
Here is my configuration:
{
"erlang_ls.erlang_ls_path": {
"type": "string",
"default": "/home/hcs/w/els/erlang_ls/_build/default/bin/erlang_ls",
"description": "path of erlang_ls"
},
"erlang_ls.port": {
"type": "number",
"default": 19527,
"description": "Port to communicate with language server."
},
"erlang_ls.trace.server": {
"type": "string",
"default": "off",
"enum": [
"off",
"messages",
"verbose"
],
"description": "Trace level of vim language server"
}
}
If I put the following debug printout lines into coc-erlang_ls/lib/index.js (ts source):
Sorry for my late reply, i just got back from holiday.
I think the problem was because of my confusing README file.
In your coc config file, the type of each config variable should be the type field of the config variable declarations in the package.json. That's my bad, i'll fix the readme very soon.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The error
When I open an Erlang file, I get the following error:
:CocInfo
shows the following error:The possible reason
Here is my configuration:
If I put the following debug printout lines into
coc-erlang_ls/lib/index.js
(ts source):then it shows that
serverPath
is an object (not a string):The problem is that the code that eventually tries to use the
serverPath
variable expects a string (not an object).If I modify the configuration file to have a string instead of an object (not only for
erlang_ls_path
but also forport
):then
coc-erlang_ls
can starterlang_ls
as expected and the problem goes away.The question is: why? Any ideas about why configuration is apparently read differently on my machine?
This is the line that reads the configuration, but I didn't get deeper into what kind of magic is done by this
WorkspaceConfiguration
object.The text was updated successfully, but these errors were encountered: