clojure-lsp / clojure-lsp/clojure-lsp
Consider a `move-to-param` refactoring action similar to `move-to-let`
- Dominant language
- Clojure
- Stars
- 1.3k
- Forks
- 180
- Avg merge
- 13m
- Merged PRs (30d)
- 4
Description
**Is your feature request related to a problem? Please describe.**
In my workflow it's pretty common to build up a function by taking some expression it contains and turning it into a parameter of the function. Right now this is a manual process.
**Describe the solution you'd like**
Ability to use code actions to refactor expressions within a function as parameters of the function. Some handling of call sites would be required as well, but I'm not sure about the best option here: using a static value (like `nil`), interactive refactoring, other (?). In any case, LSP could at least provide information about the required changes (like "update files a, b, and c") and leave it up to the client exactly how to address the requirements. The interactive refactoring option may be more challenging because not all clients have a feature for that and clojure-lsp shouldn't impose handling requirements. Just to note, [IntelliJ](https://www.jetbrains.com/help/idea/change-signature.html#change_class_signature_refactoring) and [coc.nvim](https://github.com/neoclide/coc.nvim/blob/01ddea57674bf36512923e37e45510577f36dc18/doc/coc.txt#L1073) do have something; not sure about other clients.
**Additional context**
There is a related [issue](https://github.com/clojure-lsp/clojure-lsp/issues/1131) about updating call sites when dragging params.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.