clojure-lsp/clojure-lsp

Rename namespace alias with API / CLI

Open

#1.792 aberto em 15 de mar. de 2024

Ver no GitHub
 (3 comments) (2 reactions) (0 assignees)Clojure (177 forks)batch import
APIenhancementgood first issue

Métricas do repositório

Stars
 (1.310 stars)
Métricas de merge de PR
 (Mesclagem média 47d 8h) (24 fundiu PRs em 30d)

Description

Is your feature request related to a problem? Please describe.

In the Editor integration I can point to a namespace alias and then rename it. But this feature is not exposed to the public API.

Describe the solution you'd like

Option A:

(clojure-lsp.api/rename-ns-alias!
 {:target-namespace 'clojure.string
  :alias 'str })

Running this on the project, would unify the alias to clojure.string in all files.

Option B:

(clojure-lsp.api/rename-ns-alias!
 {:from 'clojure-string
  :to 'str})

This would only match an existing alias clojure-string and rename it, independent of the target namespace it points to.

Guia do colaborador