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

Support correct namespace for exported clj-kondo hooks #1736

Open
mrkam2 opened this issue Dec 13, 2023 · 0 comments
Open

Support correct namespace for exported clj-kondo hooks #1736

mrkam2 opened this issue Dec 13, 2023 · 0 comments
Labels
enhancement New feature or request
Projects

Comments

@mrkam2
Copy link

mrkam2 commented Dec 13, 2023

Is your feature request related to a problem? Please describe.
When I create a clj-kondo hook file in resources/clj-kondo.exports/<org_name>/<lib_name>/…/<ns_name>.clj, it gets a (ns clj-kondo.exports.<org_name>.<lib_name>...) declaration which I need to fix to remove clj-kondo.exports.<org_name>.<lib_name>. prefix from it.

Describe the solution you'd like
It would be great for clojure-lsp to recognize this situation and create correct namespace declaration.

Here is a detailed example. Let's say I'm working in a library my-company/cool-lib and create a hook for a macro that lives in namespace feature.helper. I will create a hook file in resources/clj-kondo.exports/my-company/cool-lib/hooks/feature/helper.clj and I need its namespace declaration to be (ns hooks.feature.helper).

References:

  1. https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#exporting
  2. https://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#clojure-code-as-rewrite-clj-nodes
@mrkam2 mrkam2 added the enhancement New feature or request label Dec 13, 2023
@ericdallo ericdallo added this to Low priority in clojure-lsp via automation Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
clojure-lsp
Low priority
Development

No branches or pull requests

1 participant