Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

NextLS crashing with: Failed to run completion request #403

@NJichev

Description

@NJichev

Here's the full error:

[WARN][2024-03-28 14:31:27] ...lsp/handlers.lua:537"[Next LS] Failed to run completion request: ** (FunctionClauseError) no function clause matching in Sourceror.Zipper.node/1
    (sourceror 1.0.2) lib/sourceror/zipper.ex:100: Sourceror.Zipper.node(nil)
    (next_ls 0.20.2) lib/next_ls/helpers/ast_helpers/env.ex:18: NextLS.ASTHelpers.Env.build/1
    (next_ls 0.20.2) lib/next_ls.ex:593: NextLS.handle_request/2
    (gen_lsp 0.8.1) lib/gen_lsp.ex:277: anonymous fn/2 in GenLSP.loop/3
    (telemetry 1.2.1) /Users/njichev/Projects/next-ls/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
    (gen_lsp 0.8.1) lib/gen_lsp.ex:276: anonymous fn/6 in GenLSP.loop/3
    (gen_lsp 0.8.1) lib/gen_lsp.ex:397: GenLSP.attempt/4
    (stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

This happens a couple of times in the logs until it crashes the top level supervisor and next exits(I start it locally with bin/start --port 9000)

Using neovim 0.9.5 and the following setup:

return {
  "njichev/elixir-tools.nvim",
  version = "*",
  branch = "add-refactor-alias-command",
  event = { "BufReadPre", "BufNewFile" },
  config = function()
    local elixir = require("elixir")
    local elixirls = require("elixir.elixirls")

    elixir.setup {
      nextls = {
        port = 9000,
        enable = true,
        init_options = {
          mix_env = "dev",
          mix_target = "host",
          experimental = {
            completions = {
              enable = true
            }
          }
        },
      },
      credo = {enable = false},
      elixirls = {
        enable = false,
        settings = elixirls.settings {
          dialyzerEnabled = false,
          enableTestLenses = false,
        },
        on_attach = function(client, bufnr)
          vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
          vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
          vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
          vim.keymap.set("v", "<space>ar", ":Elixir nextls alias-refactor<cr>", { buffer = true, noremap = true })
        end,
      }
    }
  end,
  dependencies = {
    "nvim-lua/plenary.nvim",
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions