---
feature_story: FS_23_62_89_43
feature_title: tangent arg value completion
feature_status: TEST
---

Term tangent token means token which is "touched" by the cursor in the command line.

For example, `amer` is a tangent arg value:
```
some_command goto host dev amer| upstream qwer
```

Tangent arg value is always removed from consumption in case of `ServerAction.ProposeArgValues` (Tab-completion).

When all arg values are already consumed (except the tangent one) and it is time to decide what suggestion to generate,
there are some questions:

*   If user already completed this value before, then it makes sense to try to complete it the same way, right?

    For example, if `amer` was result of previous suggestion,
    moving cursor to the center `am|er` and completing it again should result again in `amer`.

    But... it should actually depend on the context:
    have other arg values changed between prev and next completion of `amer`?
    This moves us to the second approach.

*   Many arg values might be skipped by consumption of other args
    (e.g. singled out `data_envelope` need no clarification).

    In case of empty arg value (cursor has no tangent arg value),
    it makes sense to continue suggesting unspecified args (especially, at the end of the line):

    ```
    some_command goto host dev amer upstream qwer |
    ```

    When it has tangent arg value, the same logic makes sense -
    it is better to try to complete from unspecified arg types of already narrowed down data envelopes
    (not that `upstream` will be unspecified because tangent arg is excluded from consumption):

    ```
    some_command goto host dev amer up|stream qwer
    ```

    In fact, this is naturally a default behaviour because `argrelay` tries to propose for the next missing arg type.

Solution: keep the same behavior as for next non-tangent args by proposing only next missing arg type.

