Autocomplete popup fights with phantom for attention in css
In a css file, typing a property shows both Emmet’s “preview” and autocomplete popup. Pressing tab completes to “preview”'s value which is fine by me but then autocomplete popup should not be shown probably at all then.
You've replied to that in https://forum.sublimetext.com/t/emmet-2-0-alpha/47933/8 with reasoning why it works like that:
Yes, I’ve struggle with this preview/popup a bit. The problem is that in CSS autocomplete works differently, not like in HTML. The reason to keep autocomplete popup is to allow users to select native snippets with arrow and Enter. Unfortunately, ST doesn’t properly updates completions list when I modify abbreviation so I can’t put Emmet abbreviation as completion item in popup, thus display it as phantom
and you are probably correct but SublimeText 4 might have something to allow for better handling. For example, the latest build includes change:
Auto Complete: Running the auto_complete command when auto complete is already showing will re-query plugins for results
It also includes many many other changes to auto complete so if it's not fixable for ST3, we might be able to improve in the future.
Would like to see how it works in ST4 :)
Still some time until devs write documentation for it and until people experiment with it more. :)
BTW:
The reason to keep autocomplete popup is to allow users to select native snippets with arrow and Enter.
That doesn't work for me because I have "auto_complete_commit_on_tab": true.
As for those built-in CSS completions, it's not possible to disable them currently (I've created https://github.com/sublimehq/Packages/issues/2443 now). So I'm not sure how this could be fixed. If you would use completions popup then I guess your suggestion would be mixed together with default ones and there would be duplication (or maybe your suggestion would not necessarily be the one that gets selected).
That doesn't work for me because I have "auto_complete_commit_on_tab": true.
Indeed, something wrong with my completion provider, will check it out.
If you would use completions popup then I guess your suggestion would be mixed together with default ones and there would be duplication (or maybe your suggestion would not necessarily be the one that gets selected).
The problem is that completion item is not updated when I type further. E.g. when I start with p, it will populate completion with padding: ; item, but when I type further (p10, for example), it still uses completion with for p only
The problem is that completion item is not updated when I type further. E.g. when I start with
p, it will populate completion withpadding: ;item, but when I type further (p10, for example), it still uses completion with forponly
It might be expected as emmet completions are quite special - you can't statically provide all possible combinations upfront and the suggestions would have to change constantly while user is typing.
But the best way to be sure is to ask devs/community. I'd say that #support channel on Discord is the most effective way to get an answer but forum might work too.
That doesn't work for me because I have "auto_complete_commit_on_tab": true.
Oh, I see now: enabling auto_complete_commit_on_tab disables Enter for committing completion. I think I can’t do much about it: you should disable tab_expand option in Emmet and use another shortcut to expand abbreviation.
That would be quite confusing if I'd have to use a different shortcut to commit emmet completions than what I'm used to for committing normal completions.
That whole thing with both completion phantom and completion popup visible at the same time is IMO no-go anyway. It's clunky, it's confusing and annoying. I think the proper solution would required https://github.com/sublimehq/Packages/issues/2443 to be solved first and then you could suppress both those completions and other plugin's completions using on_query_completions and that might work well.
I agree it’s confusing, but it’s the best I could implement with current API state. Actually, suppressing completions is not a good idea, IMO. The best solution would be to allow me to re-populate completions items when user types further: I could push full abbreviation as a completion item and allow user to pick desired option. Other editors like Atom and Nova allows to do so.
The best solution would be to allow me to re-populate completions items when user types further
This may be possible in ST4. A lot of improvements have been made to the completions API.
I'm fairly certain it's possible.
With the ST4 api: set view.settings().set("mini_auto_complete", True) when a suitable view is opened, and always enable the flag sublime.DYNAMIC_COMPLETIONS in ViewEventListener.on_query_completions. This will make the AC widget inline-phantom-like, and it will make ST re-request completions on every keypress.
Note that it probably wouldn't be desired to disable AC popup in files like Vue which combine JS/html/css in same view.
Is there a setting to disable the phantom? Having the phantom and the autocomplete popup showing at the same time means it is impossible to choose an item from the autocomplete popup, it always inserts what is in the phantom, making the feature unusable in my case. I cannot seem to find a setting to disable this without disabling the entire plugin. This makes editing CSS code very, very difficult.
I’ve described how to disable abbreviation capturing: https://github.com/emmetio/sublime-text-plugin#disable-abbreviation-capturing
You can also disable preview with "abbreviation_preview": false option in Emmet preferences
@sergeche I'm referring to CSS specifically: https://github.com/emmetio/sublime-text-plugin#css-support The abbreviation preview works great elsewhere.
Ok, I’ll add option to disable previews for CSS only
Отправлено с iPhone
10 авг. 2020 г., в 15:32, Will Rowe [email protected] написал(а):
@sergeche I'm referring to CSS specifically: https://github.com/emmetio/sublime-text-plugin#css-support The abbreviation preview works great elsewhere.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
You can now enable abbreviation capturing and/or interactive previews for specific syntax types: https://github.com/emmetio/sublime-text-plugin#disable-abbreviation-capturing
Make sure you’re using v2.0.1
@sergeche thanks!