elixir-ls icon indicating copy to clipboard operation
elixir-ls copied to clipboard

Extreme slowness finding references

Open jwbaldwin opened this issue 2 years ago • 0 comments

Environment

  • Elixir & Erlang versions (elixir --version): 1.13.3-otp-24

  • Elixir Language Server version: latest

  • Operating system: ProductName: macOS Monterey ProductVersion: 12.1 BuildVersion: 21C52

  • Editor or IDE name (e.g. Emacs/VSCode): Neovim with builtin lsp

  • Editor Plugin/LSP Client name and version: neovim builtin lsp

Current behavior

Most lsp functions are fast (as I'd expect) but finding references takes REALLY long to execute:

vim.lsp.buf.references: 10 - 30 seconds to find even a single reference

lsp logs of finding 2 references (edited some information out)

[DEBUG][2022-04-22 10:24:27] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  jsonrpc = "2.0",  method = "$/status/report",  params = {    text = "😺Lua",    tooltip = "Workspace   : \nCached
 files: 209/204\nMemory usage: 100M\n"  }}
[DEBUG][2022-04-22 10:24:29] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  jsonrpc = "2.0",  method = "$/status/report",  params = {    text = "😺Lua",    tooltip = "Workspace   : \nCached
 files: 209/204\nMemory usage: 99M\n"  }}
[DEBUG][2022-04-22 10:24:32] .../lua/vim/lsp.lua:1023   "LSP[elixirls]" "client.request"        1       "textDocument/references"       {  context = {    includeDeclaration = true  },  pos
ition = {    character = 33,    line = 0  },  textDocument = {    uri = "file:///Users/<redacted file path>"  }}        <functio
n 1>    4
[DEBUG][2022-04-22 10:24:32] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 5,  jsonrpc = "2.0",  method = "textDocument/references",  params = {    context = {      includeDeclaration
 = true    },    position = {      character = 33,      line = 0    },    textDocument = {      uri = "file:///Users/<redacted file path>"    }  }}
[DEBUG][2022-04-22 10:24:36] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  jsonrpc = "2.0",  method = "$/status/report",  params = {    text = "😺Lua",    tooltip = "Workspace   : \nCached
 files: 204/204\nMemory usage: 99M\n"  }}
[DEBUG][2022-04-22 10:24:58] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  id = 5,  jsonrpc = "2.0",  result = { {      range = {        end = {          character = 64,          line = 39
        },        start = {          character = 60,          line = 39        }      },      uri = "file:///Users/<redacted file path>"    }
, {      range = {        end = {          character = 73,          line = 54        },        start = {          character = 69,          line = 54        }      },      uri = "file:///Us
ers/<redacted file path>"    } }}
[DEBUG][2022-04-22 10:25:34] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  jsonrpc = "2.0",  method = "$/status/report",  params = {    text = "😺Lua",    tooltip = "Workspace   : \nCached
 files: 204/204\nMemory usage: 100M\n"  }}

Expected behavior

That it's as fast as all the rest of the functions or at least as fast as go to references in vscode/emacs

jwbaldwin avatar Apr 22 '22 14:04 jwbaldwin