vuejs/vue-syntax-highlight

Special vue tags do not autocomplete

joshgoebel opened this issue · 4 comments

So we need something like this?

{
    "scope": "text.html - source, punctuation.definition.tag.begin",

    "completions":
    [
        { "trigger": "slots", "contents": "<slot>$0</slot>" },
        { "trigger": "component", "contents": "<component :is='$1'>$0</component>" },
        { "trigger": "transition", "contents": "<transition>$0</transition>" },
        { "trigger": "transition-group", "contents": "<transition-group>$0</transition-group>" },
        { "trigger": "keep-alive", "contents": "<keep-alive>$0</keep-alive>" }

    ]
}

It's annoying that the Vue special tags can't be tab completely like any other HTML tag. I can make a pr if this would be welcome, or perhaps there is a better way?

Ping?

Hi @yyyc514

Thank you for taking the time to point this out and look into possible solutions. I apologize for the delay.

I personally think this would be useful. I just don't want to interfere with emmet or other packages. Moreover this is just a syntax highlight package, and I believe there are other packages in place for snippets.

@yyx990803 do you have any thoughts of including snippets in the extension?

Emmet looks nice (installed). It doesn't work out of the box with Vue files though, so I'm not sure this would be a conflict. Someone using just the syntax would get the snippets for free... and someone who decided to specifically turn on Emmet for .vue files would know they were manually killing snippets (the docs mention this) in favor of Emmet.

At least that's what it seems like from reading the docs: ("How to expand abbreviations with Tab in other syntaxes")

https://github.com/sergeche/emmet-sublime/blob/master/README.md

And of course Emmet's default keybinding (Ctrl-E) isn't going to conflict with the snippets at all.