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
Recent Ruby changes add more keystrokes for me: class names and symbols #9069
Comments
Hey @kaspth! Very interesting. I guess the only relevant change in recent weeks was this one: 3921259. That was to fix #7819 but maybe I overdid it and we shouldn't include If you want to run Zed from source and give it a short: simply remove zed/crates/languages/src/ruby/config.toml Line 40 in a550b9c
cargo run .
If not, I'll give it a shot next week. Thanks for reporting! |
@mrnugget ah thank you! I'll try to run it from source, but that commit does look like it could be it. From an editing standout, I have liked that those characters weren't part of the word. But yeah, if autocomplete doesn't work without them, then… Well, I'll try to play around with this first! |
Thank you for this issue, I also noticed in a recent Zed update that in vim mode, pressing All that to say, I'm in favor of removing the |
I have a branch in which I remove the It restores some of the old behavior: The problem is that it breaks auto-complete for symbols, because now |
Fix is here: #9170 Short version: restores old word boundaries, fixes completion to work with those word boundaries. |
…Ruby word chars (#9170) This fixes #9069 by 1. reverting #7819 2. fixing completion filtering with regards to word boudaries For (2) see explanation in commit message: > Previously, this would only split words on upper-lower boundaries or > on `_`/`-`. > > The result was that we would filter out completions too aggressively. > The filter works by taking a suggested completion, say `foo_bar_lol`, split > it up into words - `foo`, `bar, `lol` - and check whether any of the words > start with the same characters as what the user already typed: `fo`, or `bar`, > ... > > In the case of Ruby, though, `:` wasn't considered a word boundary. If the > LSP would return `:foobar` when the user typed `:foo`, we'd check if there are > any completions that match `foo` (because that's the current word) but > we'd compare against `foobar`, not `:` or `:foobar`. > > With this change, we get more match candidates and thus more completions in Ruby. With that we can do (1) because we don't need these characters as word characters anymore to trigger completions. Release Notes: - Fixed word boundaries in Ruby by restoring old behavior (`@`, `:`, ... are no longer considered word characters) ([#9069](#9069)) - Fixed completions being filtered out when they happened at word boundaries on special characters (e.g. `:`) --------- Co-authored-by: Max <max@zed.dev>
@mrnugget woot, that's so cool! Thank you! |
Check for existing issues
Describe the bug / provide steps to reproduce it
After some recent Zed updates, I'm getting different behavior when I try to edit class names and symbols.
Today I was trying to type out
ActiveModel::Model
, but had a misspelling likeActiveModel::Kod
and as I went to hit to opt+delete to correct, Zed deleted the whole thing instead of justKod
. I've been used to::
being considered a word boundary previously.Double-clicking on
ActiveModel::Model
orActiveModel::Kod
also selects the whole namespace as opposed to just a piece.The same thing happens for symbols, so double-clicking on
:some_symbol
orsome_symbol_keyword:
indef some_method(some_symbol_keyword:)
now includes:
in the select.I find both these changes quite frustrating as a user because it reduces my ability to navigate around Zed with a keyboard.
As a bit tough to recall when these things changed, but I'm guessing they're related to the recent
highlights.scm
changes.cc @mrnugget
Environment
Zed: v0.125.3 (Zed)
OS: macOS 14.3.1
Memory: 16 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.No response
The text was updated successfully, but these errors were encountered: