Skip to content

Commit

Permalink
Add $selection-closing-brackets snippet variable
Browse files Browse the repository at this point in the history
* Fixes #2212
  • Loading branch information
PEZ committed Jun 1, 2023
1 parent ef7e1c7 commit 0c4a3d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/custom-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ export function makeContext(editor: vscode.TextEditor, ns: string, editorNS: str
editorNS,
repl,
selection: editor.document.getText(editor.selection),
selectionWithBracketTrail: getText.selectionAddingBrackets(
editor.document,
editor.selection.active
),
currentFileText: getText.currentFileText(editor.document),
...(editor.document.languageId === 'clojure'
? getText.currentClojureContext(editor.document, editor.selection.active)
Expand Down Expand Up @@ -184,6 +188,7 @@ function interpolateCode(editor: vscode.TextEditor, code: string, context): stri
.replace(/\$ns/g, context.ns)
.replace(/\$editor-ns/g, context.editorNS)
.replace(/\$repl/g, context.repl)
.replace(/\$selection-closing-brackets/g, context.selectionWithBracketTrail?.[1])
.replace(/\$selection/g, context.selection)
.replace(/\$hover-text/g, context.hoverText);
if (editor.document.languageId !== 'clojure') {
Expand Down

0 comments on commit 0c4a3d8

Please sign in to comment.