Open jansol opened 3 weeks ago
I'm try to reproduce this, but was unable (MacOS, Zed Nightly 0.156.0).
My steps:
mkdir /tmp/issue18582
cd $_
cargo init
zed . src/main.rs
Make src/main.rs like this:
enum Menu {
EggsWithBacon,
EggsWithSpam,
}
fn main() {
let breakfast = Menu::EggsWithSpam;
}
I position the cursor between 'With' and 'Spam' and trigger completions ("editor: show completions" from the command palette) and I don't get completions at all.
What if you start typing instead? I was able to repro this on Preview on macOS by inserting "B" at that location and picking from the popup that appeared then. I don't normally use the manual trigger command since the default hotkey conflicts with the default combination for switching between keyboard languages.
EDIT: I do get the completion popup at that position even without typing if I go through the command palette, though.
I tested in windows, behaviour same as linux. with current master
Zed: v0.156.0 (Zed Dev 1be24f77396aaade46739218e70cb059491aaedf) OS: Windows 10.0.22631 Memory: 63.2 GiB Architecture: x86_64 GPU: AMD Radeon(TM) Graphics || AMD proprietary driver || 24.7.1 (AMD proprietary shader compiler)
I was able to repro this on Preview on macOS by inserting "B" at that location and picking from the popup that appeared then.
That's the magic. I can reproduce. Thanks
For reference, VSCode does not offer completions when typing mid-word so they don't have this problem.
VSCode does not offer completions when typing mid-word so they don't have this problem
I would like to keep this functionality though, it's very handy when working with long enum or define names that have a shared prefix.
Check for existing issues
Describe the bug / provide steps to reproduce it
Consider the following:
Now if you navigate the cursor to this position:
then trigger a LSP completion and pick
Menu::EggsWithBacon
instead, the state after completion becomesWhich is not the desired completion, in fact it's not even valid code (if you are lucky). Instead of this I would expect that if completions are done with the cursor in the middle of an identifier, the entire original identifier is deleted and the cursor is placed at the end of the completed identifier, so
Environment
Zed: v0.156.0 (Zed Dev 7ce8797d78794f5a53e7a7d113e4c14a65e6297f) OS: Linux Wayland ubuntu 24.04 Memory: 31.3 GiB Architecture: x86_64 GPU: Radeon Vega Frontier Edition (RADV VEGA10) || radv || Mesa 24.0.9-0ubuntu0.1
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
No response