Fork me on GitHub
#lsp
<
2024-03-12
>
Alexander Kouznetsov00:03:59

An idea of an LSP/Calva editor action: when full namespace name is used in the code, introduce an alias and use it for all such places (or use an existing one). Example:

(ns a
  (:require [clojure.walk])

(clojure.walk/walk identity identity {:a 1})
(clojure.walk/walk identity identity {:b 2})
have an action to convert this to:
(ns a
  (:require [clojure.walk :as walk]))

(walk/walk identity identity {:a 1})
(walk/walk identity identity {:b 2})
cc @pez Could also work if original code had (:require [clojure.walk :as walk]).

DrLjótsson19:03:39

I would love the possibility to change the alias used for a namespace, in all requiring namespaces!

ericdallo21:03:37

we do have the rename for alias but not this all namespaces feature, maybe we could ask for the user