diff --git a/src/fennel-ls/formatter.fnl b/src/fennel-ls/formatter.fnl index 5c38c05..2eaddd7 100644 --- a/src/fennel-ls/formatter.fnl +++ b/src/fennel-ls/formatter.fnl @@ -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) ""))) diff --git a/test/hover.fnl b/test/hover.fnl index faa0bab..0a8accb 100644 --- a/test/hover.fnl +++ b/test/hover.fnl @@ -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 []