hyhugh / coc-erlang_ls Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
When I git clone
the repository and then run yarn install --frozen-lockfile
, I'm getting the following error:
$ yarn install --frozen-lockfile
yarn install v1.22.10
[1/5] ๐ Validating package.json...
warning [email protected]: The engine "coc" appears to be invalid.
[2/5] ๐ Resolving packages...
[3/5] ๐ Fetching packages...
[4/5] ๐ Linking dependencies...
[5/5] ๐จ Building fresh packages...
$ npx npm-run-all clean build
Watching /Users/alex/.vim/plug-plugins/coc-erlang_ls and all sub-directories not excluded by your .gitignore. Will not monitor dotfiles.
Found & ignored ./.git/logs ; is listed in .gitignore
Found & ignored ./node_modules ; is listed in .gitignore
Starting: clean
node:internal/modules/cjs/loader:930
throw err;
^
Error: Cannot find module '/Users/alex/.vim/plug-plugins/coc-erlang_ls/clean'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
at Function.Module._load (node:internal/modules/cjs/loader:772:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Indeed, there is no such file 'clean' included in the repository.
Any ideas what the fix is?
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)
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):
function startServer(serverPath, serverPort) {
return function () {
+ logger.appendLine('serverPath=');
+ logger.appendLine(JSON.stringify(serverPath));
child_process_1.execFile(serverPath, [serverPort.toString()]);
then it shows that serverPath
is an object (not a string):
serverPath=
{"type":"string","default":"/home/hcs/w/els/erlang_ls/_build/default/bin/erlang_ls","description":"path of erlang_ls"}
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 for port
):
{
"erlang_ls.erlang_ls_path": "/home/hcs/w/els/erlang_ls/_build/default/bin/erlang_ls",
"erlang_ls.port": 19527,
"erlang_ls.trace.server": {
"type": "string",
"default": "off",
"enum": [
"off",
"messages",
"verbose"
],
"description": "Trace level of vim language server"
}
}
then coc-erlang_ls
can start erlang_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.
When i run :CocInstall coc-erlang_ls
it just gives a [coc.nvim] Error on install coc-erlang_ls: Error: Invalid response from https://registry.npmjs.org/coc-erlang_ls: 404
. So i guess it isn't meant to be supported through npm.
I have cloned erlang_ls
and ran some rebar3 commands like they said. I added some stuff to my CocConfig so it looks like this:
{
"languageserver": {
//... other language servers
},
"python.jediEnabled": false,
"erlang_ls.erlang_ls_path": "/home/denlillemand/erlang_ls/",
"erlang_ls.port": 155900,
"erlang_ls.trace.server": "verbose"
}
When i open a .erl file i get smt like this:
... at LanguageClient.resolveConnection (/home/denlillemand/.config/nvim/plugged/coc.nvim/lib/language-client/client.
js:1968:44)
I copied a erlang_ls
executable into my path, didn't change anything.
I am not sure what to do ? it is also the first time i am developing with Erlang, I don't really understand all of this rebar stuff.
After installing this plugin with vim-plug, when entering both vim and nvim I recieve an error message stating
[coc.nvim]extension "coc-erlang_ls" doesn't contain main file /Users/Alex/.vim/plug-plugins/coc-erlang_ls/lib/index.js
The folder lib doesn't even exist for coc-erlang_ls, am I doing something wrong?
My ~/.vimrc
contains
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'hyhugh/coc-erlang_ls', {'do': 'yarn install --frozen-lockfile'}
and using :PlugInstall
gives me the error on loading any subsequent file with vim.
This happens independently of what is in my :CocConfig
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.