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 completion doesn't work after button with (click) event in typescript with Angular 2.0 #13414

Closed
Nikki1993 opened this issue Oct 10, 2016 · 10 comments
Labels
emmet Emmet related issues *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Milestone

Comments

@Nikki1993
Copy link

Nikki1993 commented Oct 10, 2016

  • VSCode Version: 1.5.3 && Same behaviour is seen on the latest Insider Build dated 10.10.2016.
  • OS Version: macOS 10.12

Steps to Reproduce:

  1. Generate simple angular2 project with angular-cli
  2. go to .component.ts file
  3. In the template: have something like <button (click)="test = 'Emmet works'"></button>
  4. type the word button on the next like and try to use TAB to autocomplete button element
  5. It just uses regular tab instead of emmet completion.

If you try to use tab completion before the aforementioned button click it will auto-complete correctly.

Removing the (click) part fixes the autocompletion.

@Nikki1993 Nikki1993 changed the title Emmet completion doesn't work after button with (click) event Emmet completion doesn't work after button with (click) event in typescript Oct 10, 2016
@Nikki1993 Nikki1993 changed the title Emmet completion doesn't work after button with (click) event in typescript Emmet completion doesn't work after button with (click) event in typescript with Angular 2.0 Oct 10, 2016
@Nikki1993
Copy link
Author

Issue is still there with the new 1.6 release

@ramya-rao-a
Copy link
Contributor

@Nikki1993 I am trying to get a repro. Here is what I did:

  • ran ng new to create an angular application

  • In app.component.ts file I have the below
    image

  • I dont see emmet completion anywhere inside the string in line 6.

Am I missing something?

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Apr 3, 2017
@Nikki1993
Copy link
Author

@ramya-rao-a with all the stuff done, now add a click event to the button aka
<button (click)="randomFunction()"></button>
and then on the next line type button and try to use tab to trigger emmet completion. Should fail

@Nikki1993
Copy link
Author

Hm, I just tried to do it in VSCode 1.10 and it seems like Emmet completions are not triggered at all inside template. No matter what/where I type. Could have been caused by another extension, can't remember anymore it's been months.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 3, 2017

I just tried to do it in VSCode 1.10 and it seems like Emmet completions are not triggered at all inside template

That's exactly what I see. And I dont have any extensions, so its not due to extensions that the feature stopped working.

Honestly, I didnt even know emmet worked at all inside the template

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 3, 2017

Is it possible that the completion you were seeing before was a feature of an extension?
I dont see how emmet could have ever worked in the template string

@ramya-rao-a
Copy link
Contributor

Also, one way you could get emmet features is to add the below in the settings

"emmet.syntaxProfiles": {
		"typescript": "html"
	}

Note: this will enable emmet expnasion in the whole file. So anythingyoutype followed by TAB would give you <anythingyoutype></anythingyoutype>
To get around this, you can

  • set "emmet.triggerExpansionOnTab": false and
  • set some other keybinding for the emmet expansion command OR invoke emmet expansion command from the command pallet

@ramya-rao-a
Copy link
Contributor

Closing this issue, as emmet expansions never worked inside template strings to begin with.

@ramya-rao-a
Copy link
Contributor

In the new emmet model that we are working on, extensions can now ask for emmet abbreviations in their completion provider.

Therefore, this feature request is now an extension candidate.

See #29114 (comment) for how to use the vscode-emmet-helper to get emmet abbreviation completions

All the extension needs to do is identify the areas of code where html completions are required. Like @Component({ .... template: 'any content here'})`

@ramya-rao-a ramya-rao-a reopened this Jun 27, 2017
@ramya-rao-a ramya-rao-a added *extension-candidate Issue identified as good extension implementation and removed info-needed Issue requires more information from poster labels Jun 27, 2017
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Jun 27, 2017
@ramya-rao-a ramya-rao-a added the help wanted Issues identified as good community contribution opportunities label Jun 27, 2017
@kieferrm kieferrm added the feature-request Request for new features or functionality label Aug 2, 2017
@ramya-rao-a ramya-rao-a added *extension-candidate Issue identified as good extension implementation and removed *extension-candidate Issue identified as good extension implementation labels Feb 5, 2018
@vscodebot
Copy link

vscodebot bot commented Feb 5, 2018

We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Feb 5, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emmet Emmet related issues *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

No branches or pull requests

5 participants