elixir-tools / elixir-tools.nvim

Neovim plugin for Elixir
MIT License
403 stars 30 forks source link

Configurable lsp management #24

Closed mracos closed 2 years ago

mracos commented 2 years ago

Hey, nice plugin! 💙

Been wondering if you could make the "lsp management" stuff (installing, starting the server, running tests, etc) under a configuration flag? I'm interested in other features from this plugin (e.g. ElixirFromPipe) but I don't want to lose my current lsp setup haha

mhanberg commented 2 years ago

I can make the on_attach function public, and you should just be able to call that in your existing on_attach handler and get the commands.

mracos commented 2 years ago

Ohh, that would be amazing! Another thing is, would it try to install and start the server if I have another configuration (e.g. lsp-config, nvim-lsp-installer) or that would be detected? 👀

mhanberg commented 2 years ago

If you don't call require("elixir").setup(), it won't do anything.

mracos commented 2 years ago

I see, thanks for the help! 💙

mhanberg commented 2 years ago

Pushed this change to main.

You should be able to call

require("elixir").on_attach(client, bufnr)

inside your own on_attach handler and it will set up the user commands.

Please close this issue if it works 👍

mracos commented 2 years ago

Worked perfectly! Tyvm!