Skip to content

Commit

Permalink
clojure: refactor namespace with Clojure LSp via command line
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Jan 21, 2025
1 parent bb59bb4 commit 8badec8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion docs/repl-driven-development/refactor-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<!--
=== "Practicalli Neovim Config Redux"
Expand Down

0 comments on commit 8badec8

Please sign in to comment.