Skip to content

Performance tips? #185

Open
Open
@igorgue

Description

@igorgue

Hi,

I wonder if anyone can help me make ElixirLS or NextLS perform faster on my very big project, ideally I would like to use ElixirLS only for autocomplete and NextLS for everything else. Here's my config (that works on LazyVim):

  {
    "elixir-tools/elixir-tools.nvim",
    dependencies = {
      "elixir-editors/vim-elixir",
      "nvim-lua/plenary.nvim",
    },
    ft = { "elixir", "eex", "heex", "surface" },
    -- stylua: ignore
    enabled = not vim.o.diff,
    config = function()
      local elixir = require("elixir")
      local elixirls = require("elixir.elixirls")

      local register_keys = function()
        local wk = require("which-key")
        local bufnr = vim.api.nvim_get_current_buf()

        wk.register({
          p = { "<cmd>ElixirToPipe<cr>", "To Pipe" },
          P = { "<cmd>ElixirFromPipe<cr>", "From Pipe" },
          m = { "<cmd>ElixirExpandMacro<cr>", "Expand Macro" },
          r = { "<cmd>ElixirRestart<cr>", "Restart" },
          o = { "<cmd>ElixirOutputPanel<cr>", "Output Panel" },
        }, {
          prefix = "<leader>cE",
          name = "+elixir",
          buffer = bufnr,
        })
      end

      vim.api.nvim_create_autocmd(
        "FileType",
        { pattern = { "elixir", "eex", "heex", "surface" }, callback = register_keys }
      )

      elixir.setup({
        nextls = {
          enable = true,
          -- {
          --   experimental = {
          --     completions = {
          --       enable = true,
          --     },
          --   },
          -- },
        },
        credo = { enable = false },
        elixirls = {
          enable = true,
          settings = {
            elixirls.settings({
              dialyzerEnabled = false,
              -- dialyzerFormat = "dialyxir_long",
              -- dialyzerWarnOpts = []
              enableTestLenses = false,
              -- envVariables =
              fetchDeps = false,
              -- languageServerOverridePath =
              mixEnv = "dev",
              -- mixTarget = "host",
              -- projectDir = "",
              signatureAfterComplete = false,
              suggestSpecs = false,
              log_level = vim.lsp.protocol.MessageType.Log,
              message_level = vim.lsp.protocol.MessageType.Log,
              trace = {
                server = "off",
              },
            }),
          },
        },
      })
    end,
  },

It's unbearably slow in my system (a 2021 16GB laptop), for some reason moving from insert mode to normal mode when ElixirLS is enabled is very slow, after save is understandable since mix itself is slow on big projects. Sometimes it also takes a fairly long time to open any file...

I'm on neovim NVIM v0.10.0-dev-582d7f4 but it's also very slow on NVIM v0.9.4

I also have treesitter disabled to help this work faster.

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