Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix completion-filtering by checking actual word boundaries & reduce …
…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 <[email protected]>
- Loading branch information