Git Product home page Git Product logo

Comments (7)

cr0t avatar cr0t commented on May 26, 2024 7

@hissssst @lauriannala I have found a workaround.

  1. Download the latest releases of here https://github.com/elixir-lsp/elixir-ls/releases (download elixir-ls.zip file).
  2. Find where coc.nvim have installed your Elixir's Language Server – you can do it like this:
$ find ~ -name 'language_server.sh'
/Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/language_server.sh
  1. In my case, I have replaced all the files in my /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/ directory with the files from the downloaded zip-archive – like that:
$ rm -rf /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/*
$ cd ~/Downloads
$ unzip elixir-ls.zip -d /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/

(keep in mind, that in your system -d option to unzip might not work or work differently; I ran these commands on macOS 12.1)

  1. Profit! (Now autocompletion works even in Elixir 1.13 projects!)

from coc-elixir.

lauriannala avatar lauriannala commented on May 26, 2024 2

Autocompletion is not working for me either, setting up elixir-ls on coc-config works.
CocCommand workspace.showOutput reports an error on autocompletion attempt:

[Error  - 1:50:57 PM] Request textDocument/completion failed.
  Message: an exception was raised:
    ** (CaseClauseError) no case clause matching: {:ok, 1, 11, [], [{:atom, {1, 5, nil}, :world}]}
        (elixir_sense 2.0.0) lib/elixir_sense/core/normalized/tokenizer.ex:16: ElixirSense.Core.Normalized.Tokenizer.do_tokenize_1_7/1
        (elixir_sense 2.0.0) lib/elixir_sense/core/parser.ex:230: ElixirSense.Core.Parser.fix_parse_error/3
        (elixir_sense 2.0.0) lib/elixir_sense/core/parser.ex:118: ElixirSense.Core.Parser.string_to_ast/5
        (elixir_sense 2.0.0) lib/elixir_sense/core/parser.ex:32: ElixirSense.Core.Parser.parse_string/4
        (language_server 0.7.0) lib/language_server/providers/completion.ex:100: ElixirLS.LanguageServer.Providers.Completion.completion/4
        (language_server 0.7.0) lib/language_server/server.ex:770: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2
  Code: -32000 
defmodule CocElixirIssue do
  def hello do
    Enum. # <-- Problem experienced here on autocomplete attempt.
    :world
  end
end

Version info:

Started ElixirLS v0.7.0
Elixir version: "1.13.0 (compiled with Erlang/OTP 24)"
Erlang version: "24"
ElixirLS compiled with Elixir 1.8.2 and erlang 21
MIX_ENV: test
MIX_TARGET: host

from coc-elixir.

amiralies avatar amiralies commented on May 26, 2024 2

I've switched to neovim's lsp recently and do not work much on elixir projects at work atm. so I couldn't give attention to this small project.

This extension doesn't do anything fancy it's a wrapper around elixir-ls. so with manual installation mentioned in the readme or using coc's manual configuration same experience should be available for the end user. but with extra steps. achieving out of the box experience is a bit tricky (we should publish with minimum version of elixir and otp supported by the language server to support more users and some small issues that i can't remember now).

With that being said if i find a way to automate build/publish via github actions that would be great (PR welcome).

from coc-elixir.

vinibrsl avatar vinibrsl commented on May 26, 2024 2

@hissssst @lauriannala I have found a workaround.

  1. Download the latest releases of here https://github.com/elixir-lsp/elixir-ls/releases (download elixir-ls.zip file).
  2. Find where coc.nvim have installed your Elixir's Language Server – you can do it like this:
$ find ~ -name 'language_server.sh'
/Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/language_server.sh
  1. In my case, I have replaced all the files in my /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/ directory with the files from the downloaded zip-archive – like that:
$ rm -rf /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/*
$ cd ~/Downloads
$ unzip elixir-ls.zip -d /Users/cr0t/.config/coc/extensions/node_modules/coc-elixir/els-release/

(keep in mind, that in your system -d option to unzip might not work or work differently; I ran these commands on macOS 12.1)

  1. Profit! (Now autocompletion works even in Elixir 1.13 projects!)

Thank you! That worked flawlessly :)

from coc-elixir.

hissssst avatar hissssst commented on May 26, 2024 1

Hmmm,
Setting elixirLS like described here works correctly with autocompletion
https://github.com/neoclide/coc.nvim/wiki/Language-servers#elixir

from coc-elixir.

cr0t avatar cr0t commented on May 26, 2024

From this comment elixir-lsp/elixir_sense#148 it seems that the ElixirLS version is outdated.

I (and I might assume as the other participants in this issue) have installed coc-elixir via :CocInstall coc-elixir command that is given in the README of https://github.com/elixir-lsp/coc-elixir.

It turns out that it downloads and installs an outdated (last release was 7 months ago) coc-elixir NPM package, instead of the new one.

@amiralies, is there any way to build and publish a new release to the npmjs?

If not, shall the vim-plug be a preferrable way of using this server? Or any other tips?

from coc-elixir.

cr0t avatar cr0t commented on May 26, 2024

This repo seems a little bit abandoned (on activity since May 2020, no tags after version 0.7.0, no releases of new version). @lukaszsamson do you know maintainer of this package, or if anything can be done do update the package? Sorry for disturbing you.

from coc-elixir.

Related Issues (20)

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.