Fork me on GitHub
#lsp
<
2021-04-25
>
dharrigan19:04:54

Would it be too OCD if lsp, when reordering the namespaces, could also sort the :refer [foo bar baz] too?

ericdallo19:04:26

I though this was already working :thinking_face:

dharrigan19:04:37

I didn't test it tbh 🙂

😅 2
dharrigan19:04:47

I thought it only did the require's

dharrigan19:04:49

will test in a bit 🙂

ericdallo19:04:21

yeah, it doesn't sort 😔

dharrigan19:04:24

nope, doesn't do

dharrigan19:04:28

i.e., before:

dharrigan19:04:40

(:require
   [clojure.tools.logging :as log]
   [honey.sql.helpers :as helpers :refer [select from where]]
   [honey.sql :as sql]

dharrigan19:04:07

then after a call to "clean-ns"

dharrigan19:04:29

(:require
   [clojure.tools.logging :as log]
   [honey.sql :as sql]
   [honey.sql.helpers :as helpers :refer [select from where]]

dharrigan19:04:43

it correctly reorders the require's, but doesn't sort the :refer

dharrigan19:04:50

unused refer's are correctly removed, so that part is good 🙂

dharrigan19:04:21

but it doesn't sort 😞

dharrigan19:04:38

I wonder if it will sort if I have an unused refer in

dharrigan19:04:07

so it sorts if it also detects unused refers

dharrigan19:04:19

you probably want that to be lifted out, so that sorting always happens on clean-ns

dharrigan19:04:09

[honey.sql :as sql]
   [honey.sql.helpers :as helpers :refer [select from where insert-into]]

dharrigan19:04:14

(insert-into is not used)

dharrigan19:04:22

then calling clean-ns

ericdallo19:04:26

yes 🙂

dharrigan19:04:29

[honey.sql :as sql]
   [honey.sql.helpers :as helpers :refer [from select where]]

borkdude19:04:26

I love that idea btw

ericdallo19:04:13

Found the issue, fixing it!