Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Emmet expansion for same line template literals #4

Open
mblais opened this issue Nov 26, 2018 · 9 comments
Open

No Emmet expansion for same line template literals #4

mblais opened this issue Nov 26, 2018 · 9 comments
Labels
bug Something isn't working

Comments

@mblais
Copy link

mblais commented Nov 26, 2018

I just installed the extension (thanks! :)

When I create an html inline string, the first tag I add does not get emmet-expanded - I see the emmet popup, but when I hit Enter, it disappears without substituting.

After I manually enter a valid closed tag, all works fine following it.

@pushqrdx
Copy link
Owner

@mblais I'll have to test this out once i am home. Glad you found it useful though :)

@pushqrdx
Copy link
Owner

@mblais I can't seem to reproduce this issue on latest VS, Could you please provide more details?

@pushqrdx pushqrdx added the question Further information is requested label Dec 19, 2018
@mblais
Copy link
Author

mblais commented Dec 19, 2018

Try it with your cursor at the end of a file.

I just reinstalled it - I'm getting the inline HTML syntax coloring in a .js file, but still no emmet.

My emmet is working in a .html file.

@pushqrdx
Copy link
Owner

@mblais Could you generate a file with the content that bugs? or record a quick gif. I really want to reproduce this to get it fixed.

@mblais
Copy link
Author

mblais commented Dec 22, 2018

Literally anything - I just tried this with same result:

function demo_inline_html ()
{
    var a = /*html*/`div.clas  `     // no emmet for me
    var b = html`div.cla  `     // no emmet here either
}

If you want to insert some debug info in the extension I'd be happy to send you the output.

@pushqrdx
Copy link
Owner

pushqrdx commented Dec 22, 2018

@mblais I can reproduce it now, For some reason, It's because you have the tilde on the same line. A temporary solution is to just add a new line so instead of

var a = html`div...` // This won't work

do

var a = html`
// Type your code here and emmet will behave correctly.
`

Anyways I'll try to fix this asap.

@pushqrdx pushqrdx added bug Something isn't working and removed question Further information is requested labels Dec 22, 2018
@mblais
Copy link
Author

mblais commented Dec 22, 2018

Unfortunately that doesn't work either.

@mblais
Copy link
Author

mblais commented Dec 23, 2018

I think I understand the problem: in order for emmet to work here, a couple things need to be true:

  • The backticks must be properly paired- it doesn't work if there is only the opening backtick. When I type html-backtick, the editor does not automatically close the bacltick -which it usually does- and the emmet doesn't work until that closing backtick is manually added.
  • As you mentioned, the cursor cannot be on the line with the opening backtick.
  • Similarly, the cursor cannot be on the line with the closing backtick.

When I get all the conditions correct, it works :-)

But honestly, how is a newbie supposed to guess these restrictions?

@pushqrdx
Copy link
Owner

@mblais I labeled this as a bug because, indeed, it doesn't have to be like this and this behavior is completely unexpected for the user. Problem is, this has to do more with how VSCode doesn't "officially" support embedded languages.
The limitation is a side effect rather than a bug but i'll definitely try to work around it.

@pushqrdx pushqrdx changed the title No emmet expansion of first HTML tag No Emmet expansion for same line template literals Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants