-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Ruby: Code Completion not working #7819
Comments
Hey! Did you follow the instructions here to install |
Hey @mrnugget, I just installed Solargraph and I see there are some auto-completions now, but it's still not properly auto-completing:
See here: Zed.-.flow_controller.rb.MDAcne.-.15.February.2024.mp4 |
Yeah, that's a bug on our side, I think. I saw
That matches what |
|
In Ruby `_$=@!:?` can all be part of an identifier. If we don't have them in this list, autocomplete doesn't work as expected. See: https://gist.github.com/misfo/1072693 This fixes one part of #7819 but not the whole ticket.
Alright, I got a fix for this here: #7824
Same here. I also couldn't get it to work in VS Code. I do have some ideas for how we could make launching language-servers more reliable, but this seems like we first need to find out how to get solargraph running in Rails. |
In Ruby `_$=@!:?` can all be part of an identifier. If we don't have them in this list, autocomplete doesn't work as expected. See: https://gist.github.com/misfo/1072693 This fixes one part of #7819 but not the whole ticket. Release Notes: - Fixed completions in Ruby not working for identifiers that start or end with special characters (e.g.: `@`)
…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]>
I'm going to close this because I think it's fixed. |
Check for existing issues
Describe the bug / provide steps to reproduce it
Even though code completion is enabled, it's not working for me on any file types that I tested (.rb, .html.erb).
Environment
Zed: v0.122.2 (Zed)
OS: macOS 13.4.0
Memory: 64 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
Zed.-.reviews_controller.rb.MDAcne.-.15.February.2024.mp4
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.No response
The text was updated successfully, but these errors were encountered: