Skip to content

Modifying snippet file results in duplicate completion items unless restarting Zed #28011

Open
@failable

Description

@failable

Summary

The title almost says it all...

Test snippet file

{
  "thread spawn": {
    "prefix": ["spawn", "tspawn"],
    "body": ["thread::spawn(move || {", "\t$0", "});"],
    "description": "Insert a thread::spawn call",
    "requires": "std::thread",
    "scope": "expr"
  }
}

Steps to trigger the problem:

  1. Add the above Rust snippet file.
  2. Do a refresh start of Zed.
  3. Open some Rust file, and enter spawn.
  4. Use zed to open the snippet file and add a period in the end of the description and save, e.g. "Insert a thread::spawn call." to modify the snippet file.
  5. Go back to the Rust file, and enter spawn.

Actual Behavior:

In step 3, there is single spawn in the completion menu.

Image

It step 5, there are two spawns in the completion menu.

Image

Expected Behavior:

There should be always single spawn in the completion menu.

Zed Version and System Specs

Zed: v0.181.0 (Zed Preview)
OS: macOS 15.4.0
Memory: 64 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

Labels

needs-reproNeeds reproduction steps / someone to reproducesnippets

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions