-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fixes backslash unicode autocompletion #2504
Conversation
Currently, the purpose of this PR is to catch all the issues which occur because of this fix, and try solving it here before merging |
helix-term/src/commands.rs
Outdated
@@ -3587,7 +3587,7 @@ pub fn completion(cx: &mut Context) { | |||
use helix_core::chars; | |||
let mut iter = text.chars_at(cursor); | |||
iter.reverse(); | |||
let offset = iter.take_while(|ch| chars::char_is_word(*ch)).count(); | |||
let offset = iter.take_while(|ch| chars::char_is_whitespace(*ch)).count(); |
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.
This seems to be the reverse of what you want: you want to scan backwards while char is not whitespace (stop on first whitespace)
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.
@archseer doing !chars::char_is_whitespace
seems to break everything
Another solution proposed @ChrHorn chars::char_is_word(*ch) || *ch == '\\'
which solves this particular problem.
I guess we can go along with that for now?
It would be nice if we could define this logic for the Julia LSP specifically so as to not break other langauges
The more general way would be to use the So you keep scanning back until you hit one of these characters (if the list is empty, just use |
@archseer Does this make sense? 😅 |
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.
I think these are a bit more idiomatic
It still doesn't trigger on |
Here's a summary of discussion on Matrix: I talked to the folks who implemented the LS in Julia, and according to them, cases like
Awaiting further input from @archseer on how to approach this |
Hello, I just want to say that I would really like this feature to be merged. Anything I can do to help? |
Best way to fix this issue is getting #3215 merged. Then we could get rid off the prefix filter which would also fix the backslash issue. |
Fixes #1807