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

Emmet 2.0: Insertion point is in wrong place after completion #29276

Closed
smlombardi opened this issue Jun 22, 2017 · 7 comments
Closed

Emmet 2.0: Insertion point is in wrong place after completion #29276

smlombardi opened this issue Jun 22, 2017 · 7 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@smlombardi
Copy link

  • VSCode Version: Code - Insiders 1.14.0-insider (d5e10a5, 2017-06-22T05:33:25.311Z)
  • OS Version: Darwin x64 16.6.0
  • Extensions:
Extension Author (truncated) Version
ng-template Ang 0.1.3
vscode-markdownlint Dav 0.9.1
code-settings-sync Sha 2.8.1
sort-lines Tyr 1.3.0
Bookmarks ale 0.15.2
project-manager ale 0.18.1
path-intellisense chr 1.4.2
vscode-eslint dba 1.2.11
vscode-html-css ecm 0.1.7
tslint eg2 0.15.0
auto-rename-tag for 0.0.14
Angular2 joh 2.3.3
HTMLHint mka 0.3.3
vscode-stylefmt mrm 2.4.1
angular2-inline nat 0.0.17
stylelint shi 0.25.0
ayu tea 0.4.0
change-case wma 1.0.0

(4 theme extensions excluded)


Steps to Reproduce:

  1. Type a tag, e.g. h1
  2. Accept the emmet completion, you get <h1></h1> as expected
    3.Except the cursor is after the completion, instead of inside the tag, so you can enter the text that goes in the h1 as expected.

jun-22-2017 12-51-54

@vscodebot vscodebot bot added bug Issue identified by VS Code Team member as probable bug insiders labels Jun 22, 2017
@ramya-rao-a
Copy link
Contributor

This is because the snippet returned by the emmet expand module in this case is <h1></h1> and not <h1>${0}</h1>

@sergeche This is not the case in your emmet plugin. Is there anything extra that the plugin is doing? If so, shouldnt that be moved into the emmet module?

@ramya-rao-a ramya-rao-a added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 22, 2017
@sergeche
Copy link

The ${0} marker etc is controlled by the field option of expand-abbreviation: https://github.com/emmetio/expand-abbreviation/blob/master/test/html.js#L14
It must be missing

@smlombardi
Copy link
Author

"Sequential" insertion points are missing too, such as when inserting two divs (e.g. div>div.foo+div.bar)

@ramya-rao-a
Copy link
Contributor

@sergeche That's exactly what I am using https://github.com/ramya-rao-a/vscode-emmet-helper/blob/master/src/emmetHelper.ts#L118

The issue is not that none of the tab stops are being returned. For eg: a gives <a href="${1}"></a> where as I'd expect <a href="${1}">${0}</a>

@sergeche
Copy link

The examples above works fine in Atom and unit-tests. Can you ensure that generated snippet doesn’t have expected tab stops?

@ramya-rao-a
Copy link
Contributor

Ah! I found the issue

https://github.com/ramya-rao-a/vscode-emmet-helper/blob/8272da0dc9e31d13b9f7c72ec6872c5daf23b54c/src/emmetHelper.ts#L151

Need to send null and not empty string in the text option

Thanks @sergeche !

@ramya-rao-a ramya-rao-a removed the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jun 23, 2017
@ramya-rao-a
Copy link
Contributor

Fixed with microsoft/vscode-emmet-helper@cbef48c

Thanks for reporting @smlombardi !

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants