Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should we support plumatic style defn syntax (?) #28

Open
jasonjckn opened this issue Dec 10, 2023 · 0 comments
Open

should we support plumatic style defn syntax (?) #28

jasonjckn opened this issue Dec 10, 2023 · 0 comments

Comments

@jasonjckn
Copy link
Contributor

jasonjckn commented Dec 10, 2023

Plumatic style function syntax :- can be found in a few libraries
https://github.com/plumatic/schema#beyond-type-hints
https://github.com/metosin/malli/blob/master/docs/function-schemas.md#function-schema-metadata
https://github.com/gnl/ghostwheel

is there any desire to support this out-of-the-box? it might be challenging to add an user configuration mechanism for it , and there's not a lot of downside to understanding the optional syntax. This is a qualitatively distinct problem than supporting different function definition aliases 'defn', which is more amenable to user config.

:- appears both to denote function return type, as well as function parameter(s) type, the only place where support needs to be added is the function return type as far as I can tell.

it's a trivial change in clojure-ts--docstring-query , I'm using this rough code right now, but probably needs a :match expression the literal :-
image

Expected behavior

image

Actual behavior

image

Steps to reproduce the problem

(defn foobar :- long?
  "comment string"
  [a :- long?]
  :do-something)

Environment & Version information

clojure-ts-mode version

0.2.0

Emacs version

30.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant