seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
755 stars 90 forks source link

ReadableColumn protocol could use args re-ordered #218

Closed corasaurus-hex closed 1 year ago

corasaurus-hex commented 1 year ago

Describe the bug

The order of args in the call to (defprotocol ReadableColumn .... makes both emacs and intellij unhappy.

https://github.com/seancorfield/next-jdbc/blob/develop/src/next/jdbc/result_set.clj#L109-L131

To Reproduce

You can see the difference in emacs between the ReadableColumn protocol and the RowBuilder protocol, that in RowBuilder it sees the docstring as a docstring.

20220828170115-yjpsw-result_set clj – Doom Emacs

In intellij it's much more dire because it messes with resolution of functions and classes in the definition and also interferes with locations that call this function:

20220828170314-gf2jm-next-jdbc – n j result-set

20220828170720-waofa-darn

The issue appears to be that both editors expect :extend-via-metadata true to come after the docstring, not before. The docs seem to indicate this is the expected order, too, which is probably why the editors are expecting this order even though clojure seems to accept either order.

Expected behavior

Expected the protocol to render correctly and for editors to support how they're defined.

Stacktraces

Not relevant.

project.clj/deps.edn

Not really relevant.

Environment (please complete the following information):

I guess this could be relevant?

Additional context

None.

seancorfield commented 1 year ago

Interesting edge case. Thanks!