Open ShafinKhadem opened 3 years ago
The binding indeed doesn't respect auto_completion
setting.
{ "keys": ["tab"], "command": "commit_completion", "context":
[{ "key": "auto_complete_visible" }]
},
Maybe due to "Tab will only trigger snippets..."?
The binding indeed doesn't respect
auto_completion
setting.{ "keys": ["tab"], "command": "commit_completion", "context": [{ "key": "auto_complete_visible" }] },
Maybe due to "Tab will only trigger snippets..."?
Replacing that to:
{ "keys": ["tab"], "command": "commit_completion", "context":
[
{ "key": "auto_complete_visible" },
{ "key": "setting.auto_complete_commit_on_tab" }
]
},
makes sublime respect auto_complete_commit_on_tab
settings. Behavior of tab_completion
has changed from ST3: previously it was used to directly trigger completion, now it's used to show completions.
Replacing that to:
{ "keys": ["tab"], "command": "commit_completion", "context": [ { "key": "auto_complete_visible" }, { "key": "setting.auto_complete_commit_on_tab" } ] },
makes sublime respect
auto_complete_commit_on_tab
settings. Behavior oftab_completion
has changed from ST3: previously it was used to directly trigger completion, now it's used to show completions.
The problem of this new behavior is, it doesn't respect snippet's has_next_field
. Even after aforementioned change: it doesn't respect has_next_field
when setting.auto_complete_commit_on_tab
is true and it completely disables tab completion when it's false unlike ST3. IMHO, along with aforementioned change, following should be added:
{ "keys": ["tab"], "command": "commit_completion", "context":
[
{ "key": "has_next_field", "operator": "equal", "operand": false },
{ "key": "auto_complete_visible" },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*\\w", "match_all": true },
]
},
[...] Behavior of
tab_completion
has changed from ST3: previously it was used to directly trigger completion, now it's used to show completions.
I've run into exactly this. Is there a way to get back instant try-to-complete-now when pressing tab? If not, should I open a new issue for that?
AFAIK, insert_best_completion
has been removed. It won't be available anymore.
So it is no longer possible to use tab completion without ever seeing the popup? I guess I should create a new feature request for that, then? Seems hopeless, though, since it has been explicitly removed...
You may want to try "mini_auto_complete": true,
setting instead. It is still undocumented feature as it has some rough edge cases, but luckily core devs like this feature and stated to not remove it.
It shows the best completion as phantom right after caret instead of displaying the popup. I personally prefer this feature over the old one from ST3 as it provides some kind of inline preview.
Wow, that is amazing! It's the perfect balance between a full auto-complete list popup and still providing a preview of what TAB will complete to. I also prefer this and I really hope this feature stays in. Thank you very much @deathaxe for sharing!
"mini_auto_complete" is terribly slow compared to "insert_best_completion"
_With regards to the discussion at https://forum.sublimetext.com/t/lorem-ipsum-tab-completion-occurs-even-with-tab-completion-disabled/66038/2 and reading this issue's comments, I have to conclude my suggestions about commit_completion
binding being misplaced or even misleading._
With tab_completion: false
the command "auto_complete", "args": {"snippets_only": true}
is executed when hitting tab key.
The core bug is that command displaying auto completion panel with available snippets, in case a word was entered which looks like the beginning of but doesn't exactly match any tabTrigger.
tab_completion: false
in PreferencesL
Pressing tab opens completion panel with "Lorem ipsum" being suggested.
Pressing tab inserts a tab (\t
) as it did in ST2 and ST3, if the word in front of the caret doesn't exactly match any snippet's tabTrigger.
Notes:
Completion panel should be displayed when hitting tab, if the word in front of the caret exactly matches multiple snippets' tabTriggers. E.g.: User typed Lorem
and several snippets use it as tabTrigger.
Description
adding
"tab_completion": false
to preferences doesn't stop tab_completionExpected behavior
From documentation:
Steps to reproduce
"tab_completion": false
to preferencesActual behavior
Even if tab_completion is false, pressing tab still triggers completion.
Environment