-
Notifications
You must be signed in to change notification settings - Fork 38
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 ability to tune Compliment behavior with var's metadata #77
Conversation
b059dd6
to
8bd4b09
Compare
8bd4b09
to
9e02e38
Compare
Thanks for pinging me!
I like this approach and would gladly add the meta in my projects that define let/defn/letfn (e.g.). At the same time, I feel it doesn't have to be exclusive, relative to what I proposed in #76 My reasoning being:
So, personally I'd mix both approaches, favoring metadata over an heuristic (mine is, after all) if both are positive.
Definitely, when I created #76 I hacked locally the described fix and it increased accuracy for |
Yeah, definitely.
I prefer the more generic name, as it's something we can adopt directly in nREPL as well for its built-in completion logic.
Hard question. I'd probably go with |
My experience with heuristics is a mixed bag, as you always end up with some false positives that someone will be complaining about (e.g.
It's a process. The longer something is out in the open and the better the tool support for it, the more popular it will be become. Now that so many editors internally use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this will be a great addition to CIDER 🍻.
9e02e38
to
4db62a3
Compare
This change introduces two Var metadata tags that Compliment honors:
:completion/hide true
. When a var has this meta flag, it will not be suggested by the completion like if it were private. This can be used for cases where you don't want to expose and encourage some "private API" to the user, but at the same time you cannot make it private because the other namespaces of your library to use it.:completion/locals :let|:defn|:letfn|:doseq
. You can mark your own macro with this metadata to tell Compliment that your macro can be searched for locals in the same places as in the respective basic Clojure macro.@vemv, @bbatsov Any thoughts? I have a few concerns:
:compliment/
or:completion/
? The former is more consistent, but the latter is more generic and can potentially be used by other completion providers (e.g. cljs-tooling) without paying Compliment unnecessary credit.^:completion/hide
or^:completion/hidden
?