Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning - Timeout #389

Closed
coop opened this issue Mar 6, 2024 · 14 comments
Closed

Warning - Timeout #389

coop opened this issue Mar 6, 2024 · 14 comments

Comments

@coop
Copy link

coop commented Mar 6, 2024

Very quickly after opening my project in neovim I am seeing the below timeout error when saving my project.

image

This seems to happen "about" ~5 ":w" into my workflow. Saving becomes significantly slower until I quit and restart. Disabling nextls "fixes" the problem.

I am using stock LazyVim with this additional change to lua/plugins/example.lua:

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

      elixir.setup {
        nextls = {
          enable = true,
          version = "0.19.0",
          init_options = {
            experimental = {
              completions = {
                enable = true
              }
            }
          }
        },
        credo = {},
        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 })
          end,
        }
      }
    end,
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
  }
}

Neovim version:

❯ vim --version                                       
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"

Run :checkhealth for more info

nextls version

❯ /Users/dad/.cache/elixir-tools/nextls/bin/nextls --version
0.19.1
@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

Do you format on save?

Can you share the contents of .elixir-tools/next-ls.log when you save? You can tail -f that file and watch it when the timeout happens

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

Also, disable credo as next has support for credo.

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

Also the version key isn't used in the next config, so you can remove that

@coop
Copy link
Author

coop commented Mar 6, 2024

Do you format on save?

Yes.

disable credo as next has support for credo

No problems - I don't use credo but good to know.

Can you share the contents of .elixir-tools/next-ls.log when you save? You can tail -f that file and watch it when the timeout happens

Nothing interesting in here.

13:51:29.545 id=3 [debug] handled request client -> server textDocument/formatting in 11ms

13:51:30.678 [debug] sent notification server -> client $/progress

13:51:30.678 [debug] handled notification client -> server textDocument/didSave in 709µs

13:51:30.678 [debug] sent notification server -> client $/progress

13:51:30.678 [debug] handled notification client -> server textDocument/didSave in 704µs

13:51:30.837 [debug] sent notification server -> client window/logMessage

13:51:30.837 [info] Compiled backend!

13:51:30.837 [debug] sent notification server -> client $/progress

13:51:30.850 [debug] sent notification server -> client window/logMessage

13:51:30.850 [debug] sent notification server -> client $/progress

13:51:30.850 [info] Compiled backend!

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

It definitely seems like the formatting call is timing out for some reason.

Does the timeout message happen when you format manually?

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

You can also check :LspLog to see if there are formatting requests in there that don't show up in the next log.

@coop
Copy link
Author

coop commented Mar 6, 2024

Does the timeout message happen when you format manually?

No.

@coop
Copy link
Author

coop commented Mar 6, 2024

Maybe related, maybe not... nvim just crashed and the output of `tail -f .elixir-tools/next-ls.log is

14:24:03.231 [debug] sent notification server -> client window/logMessage

14:24:03.231 [debug] Unchecked dependencies for environment dev:
* uniq (Hex package)


14:24:03.231 [debug] sent notification server -> client window/logMessage

14:24:03.231 [info]   the dependency is not available, run "mix deps.get"
* bcrypt_elixir (Hex package)
  the dependency is not available, run "mix deps.get"
* telemetry_metrics (Hex package)
  the dependency is not available, run "mix deps.get"
* opentelemetry_semantic_conventions (Hex package)
  the dependency is not available, run "mix deps.get"
* gen_state_machine (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix_live_view (Hex package)
  the dependency is not available, run "mix deps.get"
* grpcbox (Hex package)
  the dependency is not available, run "mix deps.get"
* propcheck (Hex package)
  the dependency is not available, run "mix deps.get"
* postman (Hex package)
  the dependency is not available, run "mix deps.get"
* telemetry_poller (Hex package)
  the dependency is not available, run "mix deps.get"
* eternal (Hex package)
  the dependency is not available, run "mix deps.get"
* decimal (Hex package)
  the dependency is not available, run "mix deps.get"


14:24:03.231 [debug] sent notification server -> client window/logMessage

14:24:03.231 id=322 [debug] sent request server -> client window/showMessageRequest

14:24:03.231 [info] The runtime for backend has successfully shut down.

14:24:03.233 [debug] sent notification server -> client window/logMessage

14:24:03.233 [error] Bad RPC call to node nextls-runtime-1709699041936306709@Tims-MBP: :nodedown

14:24:03.234 [debug] sent notification server -> client $/progress

14:24:03.234 [debug] sent notification server -> client window/logMessage

14:24:03.234 [debug] sent notification server -> client window/logMessage

14:24:03.234 [debug] Unchecked dependencies for environment dev:
* uniq (Hex package)
  the dependency is not available, run "mix deps.get"
* telemetry_metrics (Hex package)
  the dependency is not available, run "mix deps.get"
* opentelemetry_semantic_conventions (Hex package)
  the dependency is not available, run "mix deps.get"
* phoenix_live_view (Hex package)
  the dependency is not available, run "mix deps.get"


14:24:03.234 [debug] sent notification server -> client window/logMessage

14:24:03.234 [info] * propcheck (Hex package)
  the dependency is not available, run "mix deps.get"

I did not make any changes to mix.exs. I'm in the middle of writing tests,:w, ztrl+z, mix test path/to/file.exs, fg.

@coop
Copy link
Author

coop commented Mar 6, 2024

Followed by
image

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

did you change branches and had the mix.lock file change?

@coop
Copy link
Author

coop commented Mar 6, 2024

did you change branches and had the mix.lock file change?

No. I am in the middle of a feature doing this pattern:

:w, ctrl+z, mix test path/to/file.exs, fg.

Disabling nextls fixes the problem. So it's some combination of nextls + my vim config (stock lazy vim other than the one addition mentioned in the stop description) + my project.

I haven't tried working on a different project to see if I can replicate yet.

@mhanberg
Copy link
Collaborator

mhanberg commented Mar 6, 2024

Is this an umbrella app?

@coop
Copy link
Author

coop commented Mar 6, 2024

Is this an umbrella app?

no.

@mhanberg
Copy link
Collaborator

I believe #401 should close out this issue, I will likely release it in v0.20.2, please update and let me know if you can still reproduce.

I'll close the issue if I don't hear back in a while, but feel free to comment and I'll re-open

@mhanberg mhanberg closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants