-
-
Notifications
You must be signed in to change notification settings - Fork 45
add expression break chars #110
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
Conversation
Uhm I have never noticed that. I will confirm. |
I also got this, in Clojure symbols can never start with a number, so we need to find a way to mark sensible boundies. I got this in my console after the cursor was station next to the number 1000.
|
Also are we sure it is inf-clojure? Looks like a lumo issue. |
Well, both inf-clojure and lumo are guilty here. But inf-clojure shouldn'r be asking about completion for symbol starting with parenthesis or number, and lumo shouldn't be giving the result. I think less communication between lumo and inf-clojure is always a win, I'd say this is priority of the two guilty parties. |
I wonder if this statement on line 1227 is referncing here to the syntax table for symbol and word consistuents
Try seeing if keeping only symbol consistuent fixes it, but I must say I've never encountered memq in elisp before. |
No that that memq statmenet had nothing to do with it, I fixed it by just adding all the number to this string of chars
but now this looks bit ugly, but works and I don't get these bugs anymore. Maybe you can give this a try @arichiardi ? Try seeing if you start typing a number in a list (100) and wait for the completions to pop up, if you get the same, and if changeing |
I will definitely give it a try, thanks for digging! |
I just wonder whether break chars influence something else, like font faces or paredit. Will try a couple of things. |
Does this solve both parenthesis and number problem? Will try it out today |
Ok I confirm that this patch fixes the boundary issue, and |
No I didn't add the numbers, wait few minutes... |
Pull and try again the numbers |
It looks like it is working but now I am getting a call:
With this situation (where | is point):
So it looks like it tries to complete |
Maybe the " char is causing the string to become a word boundry. I still don't understand this way of calculating a word boundry, all I know adding this makes it bit better. Maybe we wait for more comments. If you discover something, then please share. Thanks for looking at this! |
I agree with you, in any case this should be merged now because it improves things a lot, so good job! 👍 |
inf-clojure.el
Outdated
@@ -1220,7 +1220,7 @@ See variable `inf-clojure-buffer'." | |||
(inf-clojure--read-or-nil) | |||
(inf-clojure--list-or-nil)))) | |||
|
|||
(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{(") | |||
(defconst inf-clojure-clojure-expr-break-chars " \t\n\"\'`><,;|&{()[]1234567890") |
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.
Seems to me the list of all digits should be replaced with something like [0-9]
or [:digit]
. Just check the exact syntax for this.
I've updated the PR, understood a bit better that skip-chars-backward won't solve this, but rather looking at the string after the boundries have been estimated. There's similar problem happening with getting arglists, that numbers are being looked for causing this
I will fix that with another PR soon. but with this PR I've effectively preventes inf-clojure from printing thousands of lines of completions when typing (1234 |) |
@bbatsov I have tested this and it works, just wanted to ack this and push a merge 😉 |
It seems to me that this breaks Planck on my setup. |
It would be awesome if you could enable the logging and see what is sent (if anything) to the repl |
To not get weird completions the expression boundries cant contain open or close parenthesis and open or close brackets. Otherwise, in the case of lumo, the completions will look like the following picture.
https://user-images.githubusercontent.com/6074754/27034766-3de33bbe-4f7f-11e7-821f-62204cd9f02d.png
So far after adding these chars I've not experienced this again.
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
M-x checkdoc
warningsThanks!