-
Notifications
You must be signed in to change notification settings - Fork 3
fix: remove unnecessary "bin/start-stdio" script #20
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
Conversation
I think I figured out how it's supposed to work without adding additional scripts or worrying about passed arguments. The mason-registry submission is here: mason-org/mason-registry#8368 Once refactorex is installed with mason, it can be configured using the following code: ```lua require("lspconfig.configs").refactorex = { default_config = { cmd = { vim.fn.stdpath("data") .. "/mason/bin/refactorex", "--stdio" }, filetypes = { "elixir" }, root_dir = function(fname) return require("lspconfig").util.root_pattern("mix.exs")(fname) end, settings = {}, capabilities = { textDocumentSync = { openClose = true, change = 1, save = { includeText = true }, }, codeActionProvider = { resolveProvider = true, }, renameProvider = { prepareProvider = true, }, }, }, } require("lspconfig").refactorex.setup({}) ``` As you can see, the `cmd` has the `--stdio` argument. Mason's job is mainly just to install the language server, not to actually say what will be done with it. For maximum ease, once it is accepted in Mason, we will need to also submit it to https://github.com/williamboman/mason-lspconfig.nvim, similar to how nextls has done it here: https://github.com/williamboman/mason-lspconfig.nvim/blob/main/lua/mason-lspconfig/server_configurations/nextls/init.lua ```lua return function() return { cmd = { "nextls", "--stdio" }, } end ``` So, mason is just to install the language server, mason-lspconfig is what provides the easy-to-use lsp configuration. Until it's accepted in `mason-lspconfig`, your friends can use the snippet above to get it working (once it's accepted to mason itself). Until it's accepted in mason, they can just use this plugin: https://github.com/synic/refactorex.nvim - it just downloads the refactorex source code to a local directory and runs it from there. Seems to work just fine.
Wow, that's amazing, nice job! The integration is coming out clean. Since you seem so interested in making all of this work nicely, I'd like to ask if you could move your plugin to the extensions/neovim folder in this repo along side instructions on how to set it up. After that, I'd gladly make you a project maintener so you can easily work on this integration. Also, I wouldn't mind if the integration/plugin evolves over time as we figure out the best way to do it. I don't intend to switch to neovim (at least not soon) so having someone that actually uses it would definitely make the different in providing the same experience that I try to bring to the vs code. Anyway, thank you again. I really apreciate all the effort you put into making it work for neovim users! |
I could move it to the main repository, but there are some requirements that may or may not make it a bit less desirable. The main bulk of the code can be in Now, it's possible to tell it to look in another location (for example, So, for example, with a {
"gp-pereira/refactorex",
ft = "elixir",
config = true,
} If there's not a {
"gp-pereira/refactorex",
ft = "elixir",
config = function()
vim.opt.runtimepath:append(vim.fn.stdpath("data") .. "lazy/refactorex/extensions/neovim")
require("refactorex").setup({})
end,
} which, obviously could just be mentioned in the docs, it's just kinda ugly and non-standard |
Yeah, I tried a bunch of stuff. While it can go in {
"gp-pereira/refactorex",
ft = "elixir",
config = function(plugin)
vim.opt.rtp:append(plugin.dir)
require("refactorex").setup()
end,
} .. which isn't too bad, but because there's no For the very best, most standard neovim experience, there needs to be:
I think for the time being, having a separate repository is best, and that can be archived when mason adds it. |
100% agree! Let's leave them apart for now. But I still think it would be cool if any Neovim user that lands here has some way to see your work. Maybe a redirect on the README.md to some other markdown with instructions by editor? The Neovim ones would then redirect your repo. How do you think we can do something like that? |
I think I figured out how it's supposed to work without adding additional scripts or worrying about passed arguments.
The mason-registry submission is here: mason-org/mason-registry#8368
Once refactorex is installed with mason, it can be configured using the following code:
As you can see, the
cmd
has the--stdio
argument. Mason's job is mainly just to install the language server, not to actually say what will be done with it.For maximum ease, once it is accepted in Mason, we will need to also submit it to https://github.com/williamboman/mason-lspconfig.nvim, similar to how nextls has done it here:
https://github.com/williamboman/mason-lspconfig.nvim/blob/main/lua/mason-lspconfig/server_configurations/nextls/init.lua
So, mason is just to install the language server, mason-lspconfig is what provides the easy-to-use lsp configuration. Until it's accepted in
mason-lspconfig
, your friends can use the snippet above to get it working (once it's accepted to mason itself).Until it's accepted in mason, they can just use this plugin: https://github.com/synic/refactorex.nvim - it just downloads the refactorex source code to a local directory and runs it from there. Seems to work just fine.
Sorry about the runaround with
bin/start-stdio
- learning all of this as I go ;-)