Expert LSP is now available!

Apologies, I didn’t mean to use the forum thread as an issue tracker, no.

As mentioned, snacks.nvim is really not on you but on the community IMO.

I’ll have to switch between ElixirLS and Expert a few times in my work projects to be able to file up issue about code actions but they are generally stuff like “unfold imports” or “import this or that module that we can infer only from the last part of the name”, things like that. But I’ll formulate them better and file them up properly later, if somebody does not beat me to it.

For now can you clarify what you meant about snacks tho, I’m still not certain what currently prohibits snacks from searching workspace symbols or triggering code actions.

I am on AstroNvim v5 and I only see 4 options when I press language server menu:

  • Hover diagnositcs
  • Search diagnostics
  • Search symbols (in file, not workspace)
  • Symbols outline (opens a new pane to the left)

Nothing else. But my Neovim setup is fairly new so I might have botched it. I just don’t see searching through workspace symbols at all.

Should be able to trigger them with these mappings.

I know the mappings but they are literally not even present in my config.

Sorry, I am polluting the thread. This is my own Neovim probem. I’ll ping here when I figure it out.

My main LSP for sure, quite stable, thanks for your work!

Hello. I’m testing version 0.1.0-rc.5. It seems to work correctly with GNU Emacs 30.2 + eglot + eglot-booster. I think it can be already a LSP-server for everyday usage, at least for my purposes it works fine. Many thanks for your wonderful work!

Sometimes messages like the following appear:

[eglot] Server reports (type=1): [lib] Failed to start child {XPExpert.Project.Node, "lib"}: {:badrpc, {:EXIT, {{:badmatch, {:error, :erofs}}, [{XPForge.Project, :ensure_workspace_directory, 1, [file: ~c"lib/forge/project.ex", line: 241]}, {XPForge.Project, :ensure_workspace, 1, [file: ~c"lib/forge/project.ex", line: 224]}, {XPEngine.Bootstrap, :init, 5, []}]}}}

… I’m not sure what exactly they affect.

For me, code-actions are not working reliably from NVIM.

Would love to use refactorings: rename_function, extract_function, etc.

Anyone have success with this?

There is a tracking issue for refactoring here: Audit Refactorex features · Issue #265 · elixir-lang/expert · GitHub

Rename is not implemented in general. But extract_function should work, although perhaps not in a most friendly way. The comment says “Works, must select code independently valid as a function”, I’m not 100% sure what it means.

Can you describe in more detail what you tried?

Thanks - I didn’t realize there was an open issue for this. I’ll follow up on the tracker.

I see also, independent of ExpertLS, there is an NVIM plugin refactorex.nvim. I’ll have a look at that one also.

TIL

To use that code action in neovim, one needs to first visually select some code (and that selected code needs to be valid for a function body), then trigger vim.lsp.buf.code_action() (by default mapped to gra), then choose “Extract Function” from the list of code actions. If the selected code is not valid as a function body then “Extract Function” will not appear in the list of code actions after triggering vim.lsp.buf.code_action().

I am using the some of the code actions that Expert pulled in from RefactorEx (without using a separate plugin). As mentioned in my last comment, a lot of them require knowing what one needs to do before requesting available code actions.

It seems there’s an issue with Expert where it does not detect that env variables are actually set.

I see lots of errors like this in my editor when looking at the config files in my project:

could not fetch environment variable "SENTRY_DSN" because it is not set

Disabling and re-enabling the extension sometimes works, but it seems unpredictable.

I’m using Cursor.

Verified to have been a problem in my Neovim setup. Here’s how it looks after I fixed it:

User error, not an error in Expert. Sorry for the noise.

1 Like

Please open issues on github, we dont actively monitor the forum.

In this case tho i suspect you are setting that at compile time rather than at runtime which use causing the issue

But, please open an issue and we can investigate further.