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

Add "Replace full qualified ns with alias" feature #1810

Open
mrkam2 opened this issue Apr 22, 2024 · 0 comments
Open

Add "Replace full qualified ns with alias" feature #1810

mrkam2 opened this issue Apr 22, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Projects

Comments

@mrkam2
Copy link

mrkam2 commented Apr 22, 2024

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]).

Slack discussion: https://clojurians.slack.com/archives/CPABC1H61/p1710203639508699.

@mrkam2 mrkam2 added the enhancement New feature or request label Apr 22, 2024
@ericdallo ericdallo added this to Low priority in clojure-lsp via automation Apr 22, 2024
@ericdallo ericdallo added the good first issue Good for newcomers label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
clojure-lsp
Low priority
Development

No branches or pull requests

2 participants