Git Product home page Git Product logo

Comments (12)

amiralies avatar amiralies commented on May 27, 2024 1

@jherdman it's fine to keep this issue open.

@heimann can you open a new issue?

from coc-elixir.

dylan-chong avatar dylan-chong commented on May 27, 2024 1

@heimann i solved it by building from source

here's the coc-elixir guide but i guess it might work for vscode too https://github.com/elixir-lsp/coc-elixir#troubleshooting

so i'm guessing coc-elixir might need to be built with a newer version of elixir/otp. i would be careful of otp 23 though, as it breaks a few libraries

from coc-elixir.

heimann avatar heimann commented on May 27, 2024 1

@heimann i solved it by building from source

here's the coc-elixir guide but i guess it might work for vscode too https://github.com/elixir-lsp/coc-elixir#troubleshooting

so i'm guessing coc-elixir might need to be built with a newer version of elixir/otp. i would be careful of otp 23 though, as it breaks a few libraries

Worked for me by upgrading to OTP 23 but yes, OTP 23 does break a lot of libs so I had to do some cascading updates across the board (because of deprecating of SSL 3.0 which tbh is a very good idea anyway :) ).

from coc-elixir.

amiralies avatar amiralies commented on May 27, 2024

Can you clean dependecies and try again?

from coc-elixir.

jherdman avatar jherdman commented on May 27, 2024

That definitely worked. Any idea how I might have ended up in a funky state?

from coc-elixir.

jherdman avatar jherdman commented on May 27, 2024

Apologies, I spoke too soon. The exact same crash happened:

20:18:52.187 [error] GenServer ElixirLS.LanguageServer.Server terminating
** (Mix.Error) Unknown dependency :ecto given to :import_deps in the formatter configuration. The dependency is not listed in your mix.exs for environment :prod
    (mix 1.10.4) lib/mix.ex:392: Mix.raise/1
    (mix 1.10.4) lib/mix/tasks/format.ex:246: anonymous fn/3 in Mix.Tasks.Format.eval_deps_opts/2
    (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.10.4) lib/mix/tasks/format.ex:245: Mix.Tasks.Format.eval_deps_opts/2
    (mix 1.10.4) lib/mix/tasks/format.ex:201: anonymous fn/5 in Mix.Tasks.Format.eval_deps_and_subdirectories/4
    (mix 1.10.4) lib/mix/tasks/format.ex:210: Mix.Tasks.Format.maybe_cache_in_manifest/3
    (mix 1.10.4) lib/mix/tasks/format.ex:160: Mix.Tasks.Format.formatter_opts_for_file/2
    (language_server 0.5.0) lib/language_server/server.ex:487: ElixirLS.LanguageServer.Server.handle_request/2
Last message: {:"$gen_cast", {:receive_packet, %{"id" => 111, "jsonrpc" => "2.0", "method" => "textDocument/completion", "params" => %{"context" => %{"triggerKind" => 1}, "position" => %{"character" => 11, "line" => 108}, "textDocument" => %{"uri" => "file:///Users/james/Projects/rovr_api/lib/rovr_api/subscriptions.ex"}}}}}
State: %ElixirLS.LanguageServer.Server{analysis_ready?: false, awaiting_contracts: [], build_diagnostics: [], build_ref: #Reference<0.678299566.3469737986.85132>, build_running?: true, client_capabilities: %{"textDocument" => %{"codeAction" => %{"codeActionLiteralSupport" => %{"codeActionKind" => %{"valueSet" => ["", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports"]}}, "dynamicRegistration" => true, "isPreferredSupport" => true}, "codeLens" => %{"dynamicRegistration" => true}, "colorProvider" => %{"dynamicRegistration" => true}, "completion" => %{"completionItem" => %{"commitCharactersSupport" => true, "deprecatedSupport" => true, "documentationFormat" => ["markdown", "plaintext"], "preselectSupport" => true, "snippetSupport" => true}, "completionItemKind" => %{"valueSet" => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, "contextSupport" => true, "dynamicRegistration" => true}, "declaration" => %{"dynamicRegistration" => true}, "definition" => %{"dynamicRegistration" => true}, "documentHighlight" => %{"dynamicRegistration" => true}, "documentLink" => %{"dynamicRegistration" => true, "tooltipSupport" => true}, "documentSymbol" => %{"dynamicRegistration" => true, "hierarchicalDocumentSymbolSupport" => true, "symbolKind" => %{"valueSet" => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, "tagSupport" => %{"valueSet" => [1]}}, "foldingRange" => %{"dynamicRegistration" => true, "lineFoldingOnly" => true, "rangeLimit" => 5000}, "formatting" => %{"dynamicRegistration" => true}, "hover" => %{"contentFormat" => ["markdown", "plaintext"], "dynamicRegistration" => true}, "implementation" => %{"dynamicRegistration" => true}, "onTypeFormatting" => %{"dynamicRegistration" => true}, "publishDiagnostics" => %{"relatedInformation" => true, "tagSupport" => %{"valueSet" => [1, 2]}, "versionSupport" => false}, "rangeFormatting" => %{"dynamicRegistration" => true}, "references" => %{"dynamicRegistration" => true}, "rename" => %{"dynamicRegistration" => true, "prepareSupport" => true}, "selectionRange" => %{"dynamicRegistration" => true}, "signatureHelp" => %{"dynamicRegistration" => true, "signatureInformation" => %{"documentationFormat" => ["markdown", "plaintext"], "parameterInformation" => %{"labelOffsetSupport" => true}}}, "synchronization" => %{"didSave" => true, "dynamicRegistration" => true, "willSave" => true, "willSaveWaitUntil" => true}, "typeDefinition" => %{"dynamicRegistration" => true}}, "window" => %{"workDoneProgress" => true}, "workspace" => %{"applyEdit" => true, "configuration" => true, "didChangeConfiguration" => %{"dynamicRegistration" => true}, "didChangeWatchedFiles" => %{"dynamicRegistration" => true}, "executeCommand" => %{"dynamicRegistration" => true}, "symbol" => %{"dynamicRegistration" => true, "symbolKind" => %{"valueSet" => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, "tagSupport" => %{"valueSet" => [1]}}, "workspaceEdit" => %{"documentChanges" => true, "failureHandling" => "textOnlyTransactional", "resourceOperations" => ["create", "rename", "delete"]}, "workspaceFolders" => true}}, dialyzer_diagnostics: [], dialyzer_sup: #PID<0.124.0>, load_all_modules?: false, needs_build?: true, project_dir: "/Users/james/Projects/rovr_api", received_shutdown?: false, requests: %{}, root_uri: "file:///Users/james/Projects/rovr_api", server_instance_id: "Xd8iRfwZ-VaHO1V-aKVIIQORzUvWl0lx", settings: %{"dialyzerEnabled" => true, "dialyzerFormat" => "dialyzer", "dialyzerWarnOpts" => [], "fetchDeps" => true, "mixEnv" => "test", "suggestSpecs" => true}, source_files: %{"file:///Users/james/Projects/rovr_api/lib/rovr_api/subscriptions.ex" => %ElixirLS.LanguageServer.SourceFile{dirty?: true, text: "defmodule RovrApi.Subscriptions do\n  @moduledoc \"\"\"\n  The Subscriptions context.\n  \"\"\"\n\n  import Ecto.Query, warn: false\n  alias RovrApi.Repo\n\n  alias RovrApi.Subscriptions.{ReadReceipt, Subscription}\n\n  defdelegate authorize(action, user, params), to: RovrApi.Subscriptions.Policy\n\n  @doc \"\"\"\n  Returns the list of subscriptions.\n\n  ## Examples\n\n      iex> list_subscriptions()\n      [%Subscription{}, ...]\n\n  \"\"\"\n  def list_subscriptions do\n    Repo.all(Subscription)\n  end\n\n  @doc \"\"\"\n  Gets a single subscription.\n\n  Raises `Ecto.NoResultsError` if the Subscription does not exist.\n\n  ## Examples\n\n      iex> get_subscription!(123)\n      %Subscription{}\n\n      iex> get_subscription!(456)\n      ** (Ecto.NoResultsError)\n\n  \"\"\"\n  def get_subscription!(id), do: Repo.get!(Subscription, id)\n\n  @doc \"\"\"\n  Creates a subscription.\n\n  ## Examples\n\n      iex> create_subscription(%{field: value})\n      {:ok, %Subscription{}}\n\n      iex> create_subscription(%{field: bad_value})\n      {:error, %Ecto.Changeset{}}\n\n  \"\"\"\n  def create_subscription(attrs \\\\ %{}) do\n    %Subscription{}\n    |> Subscription.changeset(attrs)\n    |> Repo.insert()\n  end\n\n  @doc \"\"\"\n  Deletes a subscription.\n\n  ## Examples\n\n      iex> delete_subscription(subscription)\n      {:ok, %Subscription{}}\n\n      iex> delete_subscription(subscription)\n      {:error, %Ecto.Changeset{}}\n\n  \"\"\"\n  def delete_subscription(%Subscription{} = subscription) do\n    Repo.delete(subscription)\n  end\n\n  @doc \"\"\"\n  Returns an `%Ecto.Changeset{}` for tracking subscription changes.\n\n  ## Examples\n\n      iex> change_subscription(subscription)\n      %Ecto.Changeset{data: %Subscription{}}\n\n  \"\"\"\n  def change_subscription(%Subscription{} = subscription, attrs \\\\ %{}) do\n    Subscription.changeset(subscription, attrs)\n  end\n\n  @doc \"\"\"\n  Creates a read receipt.\n\n  ## Examples\n\n      iex> create_read_receipt(%{field: value})\n      {:ok, %ReadReceipt{}}\n\n      iex> create_read_receipt(%{field: bad_value})\n      {:error, %Ecto.Changeset{}}\n\n  \"\"\"\n  @spec create_read_receipt(map()) :: {:ok, ReadReceipt.t()} | {:error, Ecto.Changeset.t()}\n  def create_read_receipt(attrs \\\\ %{}) do\n    %ReadReceipt{}\n    |> ReadReceipt.create_changeset(attrs)\n    |> Repo.insert()\n  end\n\n  @doc \"\"\"\n  Returns a\n  def create_read_receipt_changeset(%ReadReceipt{} = read_receipt, attrs) do\n    read_receipt\n    |> ReadReceipt.create_changeset(attrs)\n  end\n\n  @doc \"\"\"\n  Gets a single read receipt.\n\n  Raises `Ecto.NoResultsError` if the ReadReceipt does not exist\n\n  ## Examples\n\n      iex> get_read_receipt!(123)\n      [%ReadReceipt{}, ...]\n\n      iex> get_read_receipt!(456)\n      ** (Ecto.NoResultsError)\n\n  \"\"\"\n  @spec get_read_receipt!(String.t()) :: ReadReceipt.t() | :no_return\n  def get_read_receipt!(id) do\n    ReadReceipt\n    |> Repo.get!(id)\n    |> (truncated)
[Warn  - 8:18:53 p.m.] ** (exit) exited in: GenServer.call(ElixirLS.LanguageServer.JsonRpc, {:packet, %{"jsonrpc" => "2.0", "method" => "textDocument/didChange", "params" => %{"contentChanges" => [%{"range" => %{"end" => %{"character" => 13, "line" => 108}, "start" => %{"character" => 13, "line" => 108}}, "rangeLength" => 0, "text" => "`"}], "textDocument" => %{"uri" => "file:///Users/james/Projects/rovr_api/lib/rovr_api/subscriptions.ex", "version" => 136}}}}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir 1.10.4) lib/gen_server.ex:1013: GenServer.call/3
    (elixir 1.10.4) lib/stream.ex:441: anonymous fn/4 in Stream.each/2
    (elixir 1.10.4) lib/stream.ex:1449: Stream.do_element_resource/6
    (elixir 1.10.4) lib/stream.ex:1609: Enumerable.Stream.do_each/4
    (elixir 1.10.4) lib/stream.ex:649: Stream.run/1
    (stdlib 3.13) erl_eval.erl:680: :erl_eval.do_apply/6
[Error  - 8:18:56 p.m.] /Users/james/dotfiles/config/coc/extensions/node_modules/coc-elixir/els-release/language_server.sh exited with code: 1
[Info  - 8:18:56 p.m.] Connection to server got closed. Server will restart.
[Error  - 8:18:56 p.m.] Request textDocument/completion failed.
Error: Connection got disposed.
    at Object.dispose (/Users/james/.vim/plugged/coc.nvim/build/index.js:17340:25)
    at Object.dispose (/Users/james/.vim/plugged/coc.nvim/build/index.js:58041:35)
    at LanguageClient.handleConnectionClosed (/Users/james/.vim/plugged/coc.nvim/build/index.js:60352:42)
    at LanguageClient.handleConnectionClosed (/Users/james/.vim/plugged/coc.nvim/build/index.js:57653:15)
    at closeHandler (/Users/james/.vim/plugged/coc.nvim/build/index.js:60338:18)
    at CallbackList.invoke (/Users/james/.vim/plugged/coc.nvim/build/index.js:17980:39)
    at Emitter.fire (/Users/james/.vim/plugged/coc.nvim/build/index.js:18039:36)
    at closeHandler (/Users/james/.vim/plugged/coc.nvim/build/index.js:16676:26)
    at CallbackList.invoke (/Users/james/.vim/plugged/coc.nvim/build/index.js:17980:39)
    at Emitter.fire (/Users/james/.vim/plugged/coc.nvim/build/index.js:18039:36)
Started ElixirLS v0.5.0
Elixir version: "1.10.4 (compiled with Erlang/OTP 23)"
Erlang version: "23"
ElixirLS compiled with Elixir 1.10.3 and erlang 23
MIX_ENV: test
MIX_TARGET: host
==> oban
Compiling 20 files (.ex)
Generated oban app
==> plug_crypto
Compiling 5 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 40 files (.ex)
[Warn  - 8:19:23 p.m.] warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/plug/conn/wrapper_error.ex:23

from coc-elixir.

amiralies avatar amiralies commented on May 27, 2024

Not sure but I think there's caching issue with elixir-ls or elixir compiler itself.
I'm not an elixir compiler expert maybe @axelson can help

from coc-elixir.

axelson avatar axelson commented on May 27, 2024

This sounds like the same issue that is being tracked in elixir-lsp/elixir-ls#235 I'm not sure what the cause is, it seems like Mix.Tasks.Format.formatter_opts_for_file is looking at the wrong .formatter.exs or hasn't loaded the correct dependencies. Also I'm not clear what the difference between using vim for formatting and using vscode (since vscode doesn't appear to have this problem)

from coc-elixir.

jherdman avatar jherdman commented on May 27, 2024

My knowledge is near zero for this problem space at this time, and unfortunately my free time is also highly constrained. That said, I'd love to be of any service possible. What can I do to help?

Edit: Is it valuable keeping this issue open to track the problem, or shall I close it per the aforementioned parent issue?

from coc-elixir.

heimann avatar heimann commented on May 27, 2024

I'm also unable to get coc-elixir to work after updating to 0.5. Not sure if helpful for me to add my traceback here or start a new issue?

I get this (after recompiling etc)
** (UndefinedFunctionError) function ElixirLS.LanguageServer.CLI.main/0 is undefined (module ElixirLS.LanguageServer.CLI is not available) ElixirLS.LanguageServer.CLI.main()

from coc-elixir.

jherdman avatar jherdman commented on May 27, 2024

I finally got around to trying the trouble shooting suggestion, and sadly it does not work:

[coc.nvim] Server elixir failed to start: Launching server "elixir" using command ~/tools/.elixir-ls/release/language_server.sh failed

:CocInfo isn't really helpful here:

## versions

vim version: NVIM v0.4.3
node version: v14.6.0
coc.nvim version: 0.0.78-56999634f4
coc.nvim directory: /Users/james/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin

## Output channel: watchman

[Info  - 9:02:39 a.m.] watchman watching project: /Users/james/Projects/rovr_api
[Info  - 9:02:39 a.m.] subscribing "**/.eslintr{c.js,c.yaml,c.yml,c,c.json}" in /Users/james/Projects/rovr_api
[Info  - 9:02:39 a.m.] subscribing "**/.eslintignore" in /Users/james/Projects/rovr_api
[Info  - 9:02:39 a.m.] subscribing "**/package.json" in /Users/james/Projects/rovr_api
[Info  - 9:02:39 a.m.] subscribing "**/{.prettierrc,.prettierrc.json,.prettierrc.yaml,.prettierrc.yml,.prettierrc.js,package.json,prettier.config.js}" in /Users/james/Projects/rovr_api
[Info  - 9:02:42 a.m.] subscribing "**/*.{ex,exs,erl,yrl,xrl,eex,leex}" in /Users/james/Projects/rovr_api

## Output channel: prettier


## Output channel: snippets

[Info 9:02:39 a.m.] Using ultisnips directories: UltiSnips /Users/james/dotfiles/config/coc/ultisnips
[Info 9:02:39 a.m.] Using ultisnips python command: pyx

## Output channel: tailwindcss-language-server


## Output channel: elixir

[Error  - 9:02:42 a.m.] Starting client failed 
Launching server "elixir" using command ~/tools/.elixir-ls/release/language_server.sh failed.

from coc-elixir.

jherdman avatar jherdman commented on May 27, 2024

NB: Troubleshooting DID work. I'm just an idiot and used the wrong path to the language server 😅

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.