-
-
Notifications
You must be signed in to change notification settings - Fork 160
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 missing requires from comment
should not add to ns
#1316
Comments
I see 2 good possible options:
|
Yeah, either of those would work. Prompting the user is a nice idea. This is a rare enough use-case that a prompt wouldn't be too intrusive, IMO. |
Hi, I'm working on this a little: right now I've introduced a flag |
…t comment form during code action and completion. [#1316] (#1767) * add inside-rcf? predicate to edit ns * added rcf-position info to (unresolved) alias completion * added prompt and setting {:completion {:add-require-inside-comments true|false|nil} * added quick-fix functionality for require, renamed setting * added import-case and fixed autocompletion conflict * accounted for the new parameter rcf-pos * extracted shared code from ns-add-to-namespace to 2 new functions * fixed issue error when inserting 0 white-spaces, typo in parameter, changed check for existing forms * fixed: without resolving, the zloc was not at the root and the comment position could not be found * added unit tests * updated changelog * changed name of setting * updated docs * fixed changelog, order in seettings.md * changed position of new setting --------- Co-authored-by: blnote <b@s>
Fixed by #1767 |
Is your feature request related to a problem? Please describe.
Currently
add-missing-require
always adds the missing namespace to thens
's:require
form. But when in an RCF, a top-level(comment ...)
form, this isn't what some users want. They feel that this clutters theirns
with namespaces that aren't really used. They'd prefer that the missing namespace be put in a(require ...)
form in the RCF.Describe the solution you'd like
I'd like one of two things. I think the best would be a configuration option that modified
add-missing-require
's behavior. Bonus points for adding the missing namespace to an existing(require ...)
. Alternatively, there could be a new command.Describe alternatives you've considered
It's possible to add
(require ...)
by hand.Additional context
See discussion in Slack
The text was updated successfully, but these errors were encountered: