-
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
->/->> not handled #61
Comments
That's a neat idea, Victor! I also don't like the fact that typetag-based completion doesn't work when being threaded. Unfortunately, we cannot do macroexpansion in context parsing – because that potentially executes arbitrary code, and we don't want to do that on behalf of the user when just doing the completions. Imagine this very implausible but hypothetically possible scenario: (defmacro bomb-away! [& body]
(launch-bombs-for-real!)
(clojure.java.shell/sh "rm" "-rf" "/")
(System/exit 0)
~@body)
(bomb-away! (let [s "this is the code I never intended to execute"]
kw :pri___ ;; and this is where completion is automatically triggered However, I'm open to hard-coding the handling of |
Oops, sorry, I didn't look at your suggestion carefully enough to see that you are only macroexpending the threading form. That's much better. However, if this is already close to the hard-coding approach, I'd say it's better to be on the safe side and not use macroexpand at all. |
Thanks for the reply! I see :) Do you find it likely that this feature will make it reasonably soon? |
If you submitted a PR, it would be almost instant:) Otherwise, I'll have to find the time to look into it. |
👍 ! I might try things, but before I do, it's worth asking: when you see a
The two first cases seem easy to check, by inspecting How to you typically handle this? |
Yes, you can try to resolve That being said, I don't think you need to check for that at all. The cases where |
If you checked that |
Hi again! I wonder if you could give a shot to this feature. Currently I'm unable to contribute to OSS due to IP concerns (I might get that fixed at some point though... hard to tell when)
I tend to agree now. Even if a custom |
The problem
The two following pieces of code should get the same completions, but they don't:
Possible solution
Perform certain macroexpansions as an early step in
compliment.context/parse-context
.The following POC worked fine for me:
WDYT?
Cheers - Victor
The text was updated successfully, but these errors were encountered: