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 tab-key not working #18445

Closed
setuun opened this issue Jan 12, 2017 · 30 comments
Closed

Emmet tab-key not working #18445

setuun opened this issue Jan 12, 2017 · 30 comments
Assignees
Labels
emmet Emmet related issues info-needed Issue requires more information from poster

Comments

@setuun
Copy link

setuun commented Jan 12, 2017

As soon as i activate emmet...
{ "key": "tab", "command": "editor.emmet.action.expandAbbreviation", "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorHasMultipleSelections && !editorHasSelection && !editorReadonly && !editorTabMovesFocus" }
...the tab-key stop working.

Here a small video, where u can see, what i do and which expansions i use:
https://youtu.be/RDxf_KdAMRU

Note: I use windows 10, VSCode 1.8.1 portable

@mjbvz mjbvz added the emmet Emmet related issues label Jan 12, 2017
@ramya-rao-a
Copy link
Contributor

Can you check your settings to ensure emmet.triggerExpansionOnTab is not set to false?

When you have the cursor at the end of the abbreviation does running the command Emmet: Expand Abbreviation from the command pallete work for you?

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Jan 12, 2017
@setuun
Copy link
Author

setuun commented Jan 13, 2017

emmet.triggerExpansionOnTab is enabled (true). When i run the command Emmet: Expand Abbreviation, an unknown error appears and it says, there are more details in the log, but i could not find the lod. Where is it?

@ramya-rao-a
Copy link
Contributor

Can you add a screenshot of the error that you see which says "more details in the log"?
It might refer to the console or something else.

@ramya-rao-a
Copy link
Contributor

@setuun Any updates?

@setuun
Copy link
Author

setuun commented Jan 24, 2017

Sorry for my late response, but i was sick. After i started the portable version on another pc, the emmet suddenly is working again. I try to reproduce the error again. When i get it, i will immediately post it here.

@ramya-rao-a
Copy link
Contributor

Sorry to hear that, hope you feel better.
Closing this issue for now.
Do get back to us if you see any more issues

@chrisdothtml
Copy link

@ramya-rao-a I'm also getting this issue. emmet.triggerExpansionOnTab is enabled, but tab key just inserts a tab into the editor. Running Emmet: Expand Abbreviation expands as expected.


OS: macOS Sierra v10.12.5
vscode: v1.13.0-insider

@chrisdothtml
Copy link

Looks like the emmet.suggestExpandedAbbreviation setting was removed from the default settings in my version, and the emmet tab keybinding references it in its conditional:

{
  "key": "tab",
  "command": "editor.emmet.action.expandAbbreviation",
  "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !config.emmet.suggestExpandedAbbreviation && !editorHasMultipleSelections && !editorHasSelection && !editorReadonly && !editorTabMovesFocus"
}

I removed && !config.emmet.suggestExpandedAbbreviation from that keybinding and tab started working again:

{
  "key": "tab",
  "command": "editor.emmet.action.expandAbbreviation",
  "when": "config.emmet.triggerExpansionOnTab && editorTextFocus && !editorHasMultipleSelections && !editorHasSelection && !editorReadonly && !editorTabMovesFocus"
}

@ramya-rao-a
Copy link
Contributor

@chrisdothtml what is the date on your insiders? I had fixed this on Thursday (25th May) 92be0f0

@chrisdothtml
Copy link

@ramya-rao-a

2017-05-25T05:03:42.642Z

No updates available

@ramya-rao-a
Copy link
Contributor

Ah, The time zone difference. My fix should have been picked up for the Friday 26th. Looks like there was no build out then. There will be one on Monday. Can you check again then?

@chrisdothtml
Copy link

Yep, got the update. It's fixed in the default keybindings now 👍

@vinaydate
Copy link

My project is in ReasonML. I have configured settings like:

"emmet.includeLanguages": {
    "ocaml": "html",
    "reason": "html"
  }
"emmet.useNewEmmet": false,

I can use tab to expand tags in jsx file but not in Reason .re file. Tab is treated to move cursor ahead.

@ramya-rao-a
Copy link
Contributor

@vinaydate

emmet.includeLanguages is a new setting used when emmet.useNewEmmet is set to true.
Any reason you have set emmet.useNewEmmet to false?

@vinaydate
Copy link

vinaydate commented Aug 4, 2017

Somewhere else I read that useNewEmmet being true makes tab key not to work. So I made it clear that the setting is so (which is the default value, and I did not change that).

Now the next scenario is:

"emmet.includeLanguages": {
    "ocaml": "html",
    "reason": "html"
  },
"emmet.useNewEmmet": true,
"emmet.showExpandedAbbreviation": "always"

These settings make me at least ctrl-space at the tag and get suggestion, which when clicked, expands the tag in .re file. Still in this latest scenario, tab does not work

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Aug 4, 2017

@vinaydate

Do you have editor.quickSuggestions turned off? If not, then you should be able to get emmet suggestions without pressing ctrl+space explicitly

We are deprecating the "expand emmet on tab" feature. Please read https://code.visualstudio.com/updates/v1_13#_emmet-abbreviation-expansion-in-suggestion-list to know more about why we are doing this.

A workaround is to use the suggestion list or bind a new keyboard shortcut for the emmet expand command editor.emmet.action.expandAbbreviation

@vinaydate
Copy link

vinaydate commented Aug 5, 2017

editor.quickSuggestions settings have default values

"editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": false
  },

And not getting suggestions in .re files unlike .js files

Update: I don't know what happened, but after I started my (hibernated) pc today, there are auto suggestions, and expansion of tags is working.

And, I will certainly bind a new keyboard shortcut if really needed, as you suggested.

Thanks :)

@ramya-rao-a
Copy link
Contributor

@vinaydate Great, Happy Coding!

@Jujunol
Copy link

Jujunol commented Aug 22, 2017

Just got the newest update yesterday and now experiencing this bug.
When I remove config.emmet.triggerExpansionOnTab && in the when clause everything works.

@ramya-rao-a
Copy link
Contributor

@Jujunol Have you set emmet.triggerExpansionOnTab to true?

@bowtiebeej
Copy link

Why was the default emmet.triggerExpansionOnTab changed to false? I've been using it since it first came out and it's always defaulted to true. This has caused no end of frustration this evening.

@ramya-rao-a
Copy link
Contributor

@bowtiebeej You can read about the why's and the how's in the Release Notes for 1.15 or the Emmet 2.0 blog

For current state of affairs with Emmet in VS Code read the new docs page we have set up at https://code.visualstudio.com/docs/editor/emmet

@Jujunol
Copy link

Jujunol commented Aug 30, 2017

@ramya-rao-a Thanks for the suggestion. I just switched to Sublime Text and installed the emmet extension. Pretty much the same key shortcuts so it's a fantastic alternative!

@ghost
Copy link

ghost commented Sep 1, 2017

Default emmet setting is false.
"emmet.triggerExpansionOnTab": false,

@bowtiebeej
Copy link

So a bit of a new problem I have the emmet.triggerExpansionOnTab set to true but sometimes when I have content in the {} it throws an error "Failed to expand abbreviation". This has happened a few times, it's not consistent or at least not that I can find. It usually happens when I past information into the {} in something like a p{}. But it doesn't always error and if I do p{} with nothing in the {} it works.

@ramya-rao-a
Copy link
Contributor

@bowtiebeej even if you can share the contents inside the {} that causes the error, that can help. If you do find it, then please log a new issue and I can look into it

@bowtiebeej
Copy link

Is there a limit on how much can be in the {}? That might the issue. I didn't look at it from that perspective. It's rather large but I can post it. When I copied smaller amounts of text it has worked.

@ramya-rao-a
Copy link
Contributor

Are you able to repro it consistently with the large text?

@bowtiebeej
Copy link

Yes, though I didn't think about that being the cause at the time so I didn't test to find out how large the text amount needed to be. I'll test again when I get home tonight and let you know. Should I log a new issue or report that here?

@ramya-rao-a
Copy link
Contributor

Log a new one

@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
emmet Emmet related issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

7 participants