Skip to content

Commit

Permalink
Add [r|d]estructure keys refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
svdo committed Jan 10, 2023
1 parent 8ad6f5f commit 6931d3a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,18 @@
"category": "clojure-lsp Refactor",
"enablement": "editorLangId == clojure && clojureLsp:active"
},
{
"command": "clojureLsp.refactor.destructureKeys",
"title": "Destructure Keys",
"category": "clojure-lsp Refactor",
"enablement": "editorLangId == clojure && clojureLsp:active"
},
{
"command": "clojureLsp.refactor.restructureKeys",
"title": "Restructure Keys",
"category": "clojure-lsp Refactor",
"enablement": "editorLangId == clojure && clojureLsp:active"
},
{
"command": "clojureLsp.refactor.addMissingLibspec",
"title": "Add Missing Require",
Expand Down
7 changes: 7 additions & 0 deletions src/lsp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ const clojureLspCommands: ClojureLspCommand[] = [
command: 'extract-function',
extraParamFn: makePromptForInput('Function name'),
},
{
command: 'destructure-keys',
},
{
command: 'restructure-keys',
extraParamFn: makePromptForInput('Bind to'),
},
];

function sendCommandRequest(command: string, args: (number | string)[]): void {
Expand Down

0 comments on commit 6931d3a

Please sign in to comment.