Giter Club home page Giter Club logo

coc-erlang_ls's People

Contributors

dependabot[bot] avatar hyhugh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

coc-erlang_ls's Issues

`yarn install --frozen-lockfile` not working; cannot find module 'clean'

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?

Error when using configuration (The "file" argument must be of type string)

The error

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):

 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.

Not sure how to install this

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.

lib/index.js not found?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.