From 8badec88f97dc45820ed5cb9c22ab663ff2e49d2 Mon Sep 17 00:00:00 2001 From: Practicalli Engineering Date: Tue, 21 Jan 2025 20:36:37 +0000 Subject: [PATCH] clojure: refactor namespace with Clojure LSp via command line --- CHANGELOG.md | 1 + docs/repl-driven-development/refactor-tools.md | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73e8f970..8011a586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - mkdocs: error page add link to Practicalli Contributing page - source-control: new magit screenshots & gitlinker plugin use - reference: started folding page +- clojure: refactor namespace with Clojure LSp via command line ### Changed - ci: spell lychee & repository trufflehog linters warn only (false positives) diff --git a/docs/repl-driven-development/refactor-tools.md b/docs/repl-driven-development/refactor-tools.md index 8e33f11e..dcc6b5bc 100644 --- a/docs/repl-driven-development/refactor-tools.md +++ b/docs/repl-driven-development/refactor-tools.md @@ -41,13 +41,29 @@ Repeat the key binding to move the cursor to the documentation popup window and ### Code Actions -++spc++ ++"l"++ ++"r"++ rename current symbol (namespace rename not supported by LSP client) +++spc++ ++"l"++ ++"r"++ rename current symbol (namespace rename not supported by Neovim LSP client) ++spc++ ++"l"++ ++"a"++ code actions (popup with available actions) ++spc++ ++"l"++ ++"f"++ format buffer +### Rename namespace + +Clojure LSP can rename namespaces and update the corresponding file name. + +The Neovim LSP client does not seem to support file renaming so the ++spc++ ++"l"++ ++"r"++ command fails. + +Clojure LSP can be called via the command line to rename the namespace and its corresponding file name. + +!!! NOTE "Rename namespace via Clojure LSP on Command Line" + ```shell + clojure-lsp rename --from gameboard.gameboard.api.scoreboard --to practicalli.gameboard.api.scores + ``` + +> [nvim-lsp-file-operations](https://github.com/antosha417/nvim-lsp-file-operations) was tried but without success so far. + +