Repository: vscode
Issue: InlineCompletion Tab acceptance
Labels: feature-request,under-discussion,inline-completions

# Problem statement

InlineCompletion can in most cases be accepted by `Tab`, but can't be accepted when there is Tab in between the cursor and the completion.
This causes issues e.g. when interacting with multiline completions, which can be accepted by line.

1. Show multiline completion
2. Accept first line (the cursor lands on the start of the next line without tabbing applied)
3. User wants to accept the full completion by pressing `Tab`
4. Only Tab is added, and the completion **can refresh**

This model of interaction causes frustration for users, who expect that the acceptance would actually apply the completion. And creates unwanted space for errors.

[To replicate try here (try accepting line and fully accepting completion from the line 8)](https://microsoft.github.io/monaco-editor/playground.html?source=v0.47.0-dev-20240304#XQAAAAIpFgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscxkbUIcVciAKctgAboa7AaZZDHLgrLqPRv_fRv2RyIokydlTdTYccsu6v6jDrc8jQ8utukPwKUQj21lefoa4Ak07ce0C1ZXB17Y_WPqBV6coDMOkA1SUvGDrrMuKnpxv54XSOkHm8X4HqqFPOTZqzZL7M_eZQq6cV0N8SG0OPgIHgNC1qgK5TuE_sTkh0n_jdkt_Co-zJKqLZe8HljL0tkQU0J3ZMUmO2Yb96pNIyRm6oK7ZGwD0vFq4NbSpFTV6Ra4V5wZ25yZvFCRJ24Bl38P-NY2uQubUJ0_soYAmCqQ_UQJ2Dfhdz_pHK9oCKYka16EHD4ScIq153OeHvwm5wuPab8RLI1m6Oj-CuBN8VGlzLr8qeXvtTZ9j_1ZH1JS3dFyt-UbToVxHoOswtZNZ2T-h7jTLAItFUZvxv81vYsVmFT1GcIfYOXqb62qtqUnue71nXNb9Lhl4rvG26V6ke7Nns4-C9zrt6s8tH0oTfgN1AzNcn8vD_XvdW1Em32ZZzBcwh6ikY0SNJE_BaYdo4qpoCLN2k3TE0KmA7NsOAAcdh3EK6yGJ6enRJmuGjtnjb-Yjxj2ncUynofAWfYouXyw_mAyXsxMFXs1-m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vlBPiGqtrGsXwVMePWT1qE8mJOwAgcXRE8nukPch5IW8HYIJuv3AhJmghJb4MxBjehwmN5QX-kxx_g7z8LYbZbme-u9RR4Z-bXZBY489U5R61-umb2xct5YcmHZQ0Olc3zOHewqcOgdonYwrtBXF-ZtySyeKRiUb-kjB9175kHgDMigpF9hELuqB55DlYhBpBtTb2aQf23kYY-v592EYimsj_ySWY0zVrdJARkZzrEh6B8OR9M_1_pATXeBPBEZXymSv1DzljwxS5k78r39qyazciToYXr70Ep5rFf-etuRDoru25Vx_es-TYm__F58HGrKSj1rsczfc1U-wN-WruZRJZl1v0RYCt0f1LQ3v-Eb-575beWeD5zXrBu6tDCtT211RdnUujrtUtmkmwvwHJLsZKzXSzm6Zy_lt1bJoY-OkNQbVPFprOuWQKOfXurXlsmW_7fxvqhQ9_qtT8fLEGiGNQSuZvXBAt96W-hVHBVCWahPN1uRCXvtxcUgebzjw7oAimeokFl5-7ByhB8tIctn_51_wNhoqhyaSNH-hy9_xpmjqOTumkC737degjhCchBob8laxyRcwccdGW8_zzOcyiQNvWPnH9XLG5_oSXoqA-ztyRjxyq8ulajRtX3xlCZoL8plW7oOhv2jVuzXlBVlJ1FnzQsltPHvNr9fr0Dk7r3-6HhsGs7J8KqgVVYjfjqZz0v3gQ_RyesV4yF60BGsV3lNgWNBp1_b21eY0FUKyuZrqwVMFbb09LglYgUb9zJD73U3P2yY-pP9JGtOyh7OKd0oNM74QMdMOMLcb_UTZIA)

# Possible solution

I understand that there might be some internal reasons to why this was introduced, so I wonder whether we can at least allow the specific completions (Completion Providers) to decide whether this should be applied or not. The same way as `enableForwardStability` is a inlineCompletion flag.

`enableTabPrefixAcceptance` would be a flag that would allow extensions to have a better control over the acceptace of their provided completions.