Skip to content

Zed's autocomplete for Lua incorrectly prefers "dofile" over do after a for statement #22537

Closed as not planned
@danutsu

Description

@danutsu

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

It is very common in Lua to write:

for k,v in pairs(foo) do
-- ...
end

In Zed, whenever you type for k,v in pairs(foo) do the autocomplete opens and prefers the completion dofile. If you simply press enter at this point (because the line is over), it will insert dofile. It means you have to press Escape every time after this extremely common Lua pattern.

Could we change it so that the default completion in this case is do?

Thank you!

Zed Version and System Specs

Zed: v0.168.0 (Zed Dev d54662e) OS: Linux Wayland debian 12 Memory: 58.7 GiB Architecture: x86_64 GPU: AMD Radeon RX Vega (RADV VEGA10) || radv || Mesa 22.3.6

If applicable, add screenshots or screencasts of the incorrect state / behavior

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    autocompletionsFeedback for code completions in the editorbug[core label]languageAn umbrella label for all programming languages syntax behaviorsluaLua programming language supportstaleLabel used by `stale` action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions