Skip to content

Commit

Permalink
feat: add refactorex
Browse files Browse the repository at this point in the history
[RefactorEx](https://github.com/gp-pereira/refactorex) is an LSP server
that allows for refactoring Elixir code. It adds the ability to rename
symbols via `vim.lsp.buf.rename()` and various code actions.

Tested with 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({})
```

Originally I had the build section like this:

```yaml
source:
  # renovate:datasource=github-tags
  id: pkg:github/gp-pereira/[email protected]
  build:
    run: |
      mix deps.get
      mix compile
```

However, it would never run `mix compile`, that step was always just skipped.
Not sure why.
  • Loading branch information
synic committed Dec 29, 2024
1 parent e96e77f commit 89c8509
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/refactorex/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: refactorex
description: Language server allowing for refactoring Elixir code
homepage: https://github.com/gp-pereira/refactorex
licenses:
- MIT
languages:
- Elixir
categories:
- LSP

source:
# renovate:datasource=github-tags
id: pkg:github/gp-pereira/[email protected]
build:
run: mix do deps.get, compile

bin:
refactorex: exec:bin/start

0 comments on commit 89c8509

Please sign in to comment.