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

Typing : * $ @ etc in emmet abbreviation stops showing suggestions #29758

Closed
jens1o opened this issue Jun 28, 2017 · 16 comments
Closed

Typing : * $ @ etc in emmet abbreviation stops showing suggestions #29758

jens1o opened this issue Jun 28, 2017 · 16 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues suggest IntelliSense, Auto Complete verified Verification succeeded
Milestone

Comments

@jens1o
Copy link
Contributor

jens1o commented Jun 28, 2017

  • VSCode Version: Code - Insiders 1.14.0-insider (63def6e, 2017-06-28T05:16:57.588Z)
  • OS Version: Windows_NT ia32 10.0.15063
  • Extensions:
Extension Author (truncated) Version
Bookmarks ale 0.15.2
path-intellisense chr 1.4.2
gitignore cod 0.5.0
gitlens eam 4.2.0
tslint eg2 0.15.0
LogFileHighlighter emi 1.1.1
vscode-reveal evi 0.0.9
php-debug fel 1.10.1
php-intellisense fel 1.4.1
auto-close-tag for 0.4.2
gc-excelviewer Gra 1.1.15
composer ika 0.5.0
smarty imp 0.2.0
json-to-ts Mar 1.4.3
vscode-apache mrm 1.1.1
cpptools ms- 0.12.0
github-issues-prs ms- 0.2.0
php-docblocker nei 1.2.0
vscode-code-outline pat 0.0.6
vscode-versionlens pfl 0.19.1
vscode-icons rob 7.10.1
sharecode Rol 0.4.1
code-spell-checker str 1.2.0
lorem-ipsum Tyr 1.0.0
vscode-todo-highlight way 0.5.5
highlight-trailing-white-spaces yba 0.0.2

(2 theme extensions excluded)


Steps to Reproduce:

  1. Create a new index.html file
  2. Write html, see there is a html:5 suggestion
  3. Type :, they are gone. 😢

Reproduces without extensions: Yes

@vscodebot vscodebot bot added the insiders label Jun 28, 2017
@mjbvz mjbvz added the emmet Emmet related issues label Jun 29, 2017
@ramya-rao-a ramya-rao-a added this to the June 2017 milestone Jun 29, 2017
@ramya-rao-a ramya-rao-a added the bug Issue identified by VS Code Team member as probable bug label Jun 29, 2017
@ramya-rao-a
Copy link
Contributor

@jrieken Looks like something changed in the filtering logic of suggestions. Your recent change around the inComplete:true maybe?

The emmet completion provider returns a completion list with inComplete set to true.
In stable, every letter typed would call the completion provider, but : would just filter existing results.

Stable:

stablefilter

In the current Insiders, every letter typed still calls the completion provider, but : filters out everything

Current Insiders:

currentfilter

@ramya-rao-a ramya-rao-a added the suggest IntelliSense, Auto Complete label Jun 29, 2017
@jens1o
Copy link
Contributor Author

jens1o commented Jun 29, 2017

Yes, I was curious in the first moment why it stopped working.

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

Oh, bummer... That's a regression from a change I made yesterday to fix #28400. I'll might revert that change...

@jens1o
Copy link
Contributor Author

jens1o commented Jun 29, 2017

Sorry to bother you. :/

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

Hm, reverting 5ad1618 (which is the fix for #28400) doesn't help. @ramya-rao-a It seems that : is registered as a trigger character and when we see that we invoke the provider in question and merge its results with the existing result. No, the problem is that that provider doesn't return anything and that the existing results don't match anymore because we compare html: with html etc. Needs more drilling...

screen shot 2017-06-29 at 09 32 03

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

@jrieken Looks like something changed in the filtering logic of suggestions. Your recent change around the inComplete:true maybe?

So, we did make a change yesterday (I think too early for the version this was reported for) which does the following: When a suggestion result is incomplete and if the word as stopped we don't re-trigger suggestions but filter the suggestions we currently have. So, when typing html: the word ends and we stop asking for new suggestions (that might be a problem with expansions form html:foo"bar but I am unsure that exists). However, since the results already contain html:5 it will be shown and can be selected.

I wonder if this was caused by having another provider that registers with the : trigger character (I believe 7ba1dcf). So what happens, and I don't think much has changed there, is that hitting a trigger-character only asks that provider (which doesn't return a result). Its (empty) result is being merged with the existing completions (from the incomplete provider) which didn't get a chance to update and hence fail the filter condition.

In short, there is something off. I am not yet convinced that a recent change caused this but things are complex. I acknowledge that there is a race between incomplete suggestions and trigger-characters, however I am a little scared to make a change late in the endgame.

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

Ok, the competing provider is the html-extension that registers those completion item provider: https://github.com/Microsoft/vscode/blob/master/extensions/html/server/src/htmlServerMain.ts#L75. Still not sure what as changed but I'll think about a fix

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

@ramya-rao-a I do have a change ready that makes sure to also resolve incomplete suggest results when a trigger character is being hit. However, when I ask emmet for completions with the html: prefix I just get that back, so no html:5. Fixing this bug uncovers another bug...

I believe that this used to work by accident (more than one thing is off here) and that's because before the completion item would have a just the label html:5 and now it has a filterText which ishtml. The filter text, when provided, must match, but it doesn't because it's shorter than html:.

screen shot 2017-06-29 at 14 26 24

screen shot 2017-06-29 at 14 28 27

Final word: There is something off when resolving incomplete suggest results when a trigger character is being hit, changing that is too risky IMO, and reveals other bugs in emmet (e.g. hit Ctrl+Space after html: in any version). So I'd opt for removing/fixing the filter text and things should be back to normal.

@ramya-rao-a
Copy link
Contributor

Thanks for all the digging @jrieken
I agree its too late in the end game for risky fixes.

I believe that this used to work by accident

I have added : as trigger character for emmet completions and updated the completion provider to return expected items.
So after 42ae1fc and microsoft/vscode-emmet-helper@5875048, we get expected outcome.

@ramya-rao-a
Copy link
Contributor

Still an issue for abbreviations like ul*2
The suggestions disappear when * is typed.

Re-opening

@jrieken
Copy link
Member

jrieken commented Jun 29, 2017

Yeah, whenever we hit a word stops with incomplete results and when the result isn't matching that we cancel. That was done in 5ad1618. Feel free to revert and reopen the corresponding issue. I am on vacation now... 🏖

@jens1o
Copy link
Contributor Author

jens1o commented Jun 29, 2017

Happy holidays @jrieken 😃

@ramya-rao-a ramya-rao-a changed the title Typing html:5 does not result in an suggestion in emmet Typing : * $ @ etc in emmet abbreviation stops showing suggestions Jun 29, 2017
ramya-rao-a added a commit that referenced this issue Jun 30, 2017
@ramya-rao-a
Copy link
Contributor

I add the * and $ to trigger char list as well. So we are good on those fronts.

@ramya-rao-a
Copy link
Contributor

Note to verifier:

@nanaasumadu
Copy link

nanaasumadu commented Jun 30, 2017

@ramya-rao-a

Just tested emmet suggestions with : and * in the latest insider build and there work fine. $ also works in my php file but I am not sure if that's coming from emmet or the language server.

Thank you so much for your great work.

@isidorn isidorn added the verified Verification succeeded label Jun 30, 2017
@ramya-rao-a
Copy link
Contributor

Thanks for all the feedback @nanaasumadu and @jens1o

@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 emmet Emmet related issues suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants