improved formatting for destructure
This commit is contained in:
parent
cab3bbc49d
commit
0dd9c0ff65
@ -14,9 +14,14 @@ user code. Fennel-ls doesn't support user-code formatting as of now."
|
||||
(.. (code-block (.. "("
|
||||
(tostring special)
|
||||
(if name (.. " " (tostring name)) "")
|
||||
(.. " " (view args
|
||||
{:one-line? true
|
||||
:prefer-colon? true}))
|
||||
(.. " "
|
||||
(: (view args
|
||||
{:empty-as-sequence? true
|
||||
:one-line? true
|
||||
:prefer-colon? true})
|
||||
:gsub ":([%w?_-]+) ([%w?]+)([ }])"
|
||||
#(if (= $1 $2)
|
||||
(.. ": " $2 $3))))
|
||||
" ...)"))
|
||||
(if docstring (.. "\n" docstring) "")))
|
||||
|
||||
|
||||
@ -80,10 +80,12 @@ new message handler `msgh`.")
|
||||
(check "(λ foo| [x ...]
|
||||
\"not a docstring, this gets returned\")"
|
||||
"```fnl\n(fn foo [x ...] ...)\n```")
|
||||
;; TODO cleanup signatures
|
||||
; (check "(λ foo| [{: start : end} ...]
|
||||
; :body)"
|
||||
; "```fnl\n(fn foo [{: start : end} ...] ...)\n```")
|
||||
(check "(λ foo| [{: start : end}]
|
||||
:body)"
|
||||
"```fnl\n(fn foo [{: end : start}] ...)\n```")
|
||||
(check "(λ foo| [{:list [a b c] :table {: d : e : f}}]
|
||||
:body)"
|
||||
"```fnl\n(fn foo [{:list [a b c] :table {: d : e : f}}] ...)\n```")
|
||||
nil)
|
||||
|
||||
(fn test-multisym []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user