Skip to content
This repository was archived by the owner on Aug 22, 2019. It is now read-only.
This repository was archived by the owner on Aug 22, 2019. It is now read-only.

VS Code -- emmet 2.0 -- syntax, placeholders, tabstops, ${cursor}, | , $0, $1, $2, etc. #3

@user3323

Description

@user3323

Damn.. There are so many problems with all these $1, $2, $0, ${}, | , ${cursor}, etc...
No offence, but it seems like the keystone method of their work is Math.random() 😐

Well, here are some bugs, that I found:



the vertical symbol | (that should be responsible for the caret position after snippet expansion)

in the beginning of the value:

image

makes this snippet disappear

image



and at the same time everything OK, when we put this symbol | - to the end of snippet:
image

⬇️

image



if we put it in the property:

image

it goes out as is:

image

or in the property and in the value:

image

as is:

image



if it will be in the middle of the value - it would chop off a half of it:

image

⬇️

image



https://docs.emmet.io/customization/snippets/ says:

image

... ${cursor} or | are synonyms to $0 and used as caret position in generated output.

OK, let's check the ${cursor} thing...

image

... at the first glance:
image

... and then
image

So, no placeholder where we put it, nothing happened. (and BTW no focus on the "none", bug from here https://github.com/emmetio/css-snippets-resolver/issues/2 is "fixed" 😄)



well, actually no matter what you will write in the curly braces, cursor, or something else:

image
will give the same effect - nothing will happen:

image



$0 $1 - in the property
$2 - in the value

image

almost everything is fine:

lsn 0 1 2

why almost? there is no semicolon in the end.

@ramya-rao-a, btw is that ok, that emmet's snippets syntax about $0 (the first placeholder) goes upstream against VS Code snippets syntax, where $0 - the final placeholder? It makes a little confusion.



$0 $1 - in the property

image

the same as above... placeholders works fine, and no semicolon in the end

image



but, if we will try to put a placeholder just in the value
$0 - in the value

image

emmet will output it as is:

image

... with semicolon in the end



and if zero would be wrapped in curly braces, it will work as it should:

image

image



And one more thing - about mentioned semicolons.
The good old emmet module, as I remember, was absorbing semicolon in the end of user's custom snippets, if there was one.
The new emmet (ver 2.0) does not. It just adds one more.

so this:
image

becomes this:
image



Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions