Skip to content

Autocomplete replaces the existing expression incorrectly JS/TS #27353

@v57

Description

@v57

Summary

Autocomplete replaces the existing expression instead of wrapping it when accepting a suggestion.

Steps to trigger the problem:

Type the following code in Zed (JS/TS):

this.value

Place the cursor before this.value.
Start typing Math.ro and press Enter to accept the Math.round autocomplete suggestion.

Actual Behavior:
The code is transformed into:

Math.round(|x|).value // Cursor selection marked by |

Zed inserts Math.round(x) instead of correctly wrapping the existing expression.

Expected Behavior:
The code should transform into:

Math.round(this.value)|

or

some = Math.round|this.value // Current behavior in VSCode

Autocomplete should wrap this.value instead of replacing it with a generic placeholder.

videos
425948000-3c8e0542-bb54-4198-98a0-0bd1f59ea18c.mp4
425948001-f099b7ef-8b18-46c6-92af-941b1bde9822.mp4

Zed Version and System Specs

Zed: v0.178.5 (Zed)
OS: macOS 15.3.2
Memory: 18 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:autocompletionsFeedback for code completions in the editorstaleLabel used by `stale` actionstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions