Skip to content

Auto-completion ignores variable nodes when competing with literal keywords on trailing spaces #145

Description

@devibinoy

Issue

When the parse tree offers both a variable and a keyword as valid next tokens, and that keyword happens to be lexically unique among the keyword candidates, match_complete_mr() silently auto-completes to that keyword - inserting it into the buffer plus a trailing delimiter without ever showing the user that a variable was also valid at that position.

Steps to Reproduce

Given these commands:
show tunnel history <id:int>
show tunnel history detail

show tunnel history<tab> ->displays id and detail
<id> detail

show tunnel history<tab><tab> -> autocompletes to detail
show tunnel history detail

But,
show tunnel history<space><tab> ->straight away autocompletes to detail
show tunnel history detail

Expected behaviour:

show tunnel history<space><tab> -> displays id and detail
<id> detail

show tunnel history<space><tab><tab> -> autocompletes to detail
show tunnel history detail

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions