Skip to content

Consider triggering completion automatically at snippet tabstops #1947

Open
@muirdm

Description

@muirdm

It would be cool if lsp-mode could automatically trigger completion at each snippet tabstop. For example, when expanding foo(${1:a}, ${2:b}), lsp-mode would trigger completion (with an empty prefix) at $1. If the user chooses a candidate (or starts typing to filter candidates), the "a" placeholder would be overwritten. After finishing completion at $1, the user presses TAB and advances to $2, automatically triggering a new completion.

I considered opening an LSP proposal to add a "COMPLETE" snippet variable so the server explicitly triggers this behavior, but it seems like you almost always want completion for snippet tabstops/placeholders, so I'm not sure we need that. Are there any common cases where a user wouldn't want completion triggered at tabstops?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions