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

Intellisense Global Identifier suggestion prevents Emmet suggestions from appearing/working properly #66013

Closed
webdevpchoi opened this issue Jan 4, 2019 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues verified Verification succeeded

Comments

@webdevpchoi
Copy link

webdevpchoi commented Jan 4, 2019

  • VSCode Version: 1.30.1
  • OS Version: Windows_NT x64 10.0.17134

User Setting:
image

Steps to Reproduce:

  1. Open .js file with language mode set as Javascript React.
  2. Create a React Component (in this case, Inventory.js).
    image
  3. Within the return statement, try to use emmet abbreviation to create a <div className="inventory"></div>
    image
  4. I do not get an emmet suggestion; instead, VS code suggests a series of Global Identifier suggestion. I don't want this suggestion. I want the emmet suggestion.
    image
  5. Hitting enter will choose the Global Identifier suggestion, and not expand Emmet.
    image

Other methods I've tried:

  1. Typing in .inventory, which again, suggests the filename, so Emmet doesn't expand.
    image
  2. Tried typing outside of return statement using .inventory, and that seemed to show the emmet suggsestion, instead of filename:
    image

Would love to know how to fix this!

Update: I don't have a solution, but I can recreate this solution in any .js file by first creating an opening and closing parenthesis, and then typing in a . after, like so: (.). This drops down a list of (no clue what this list is from...how can I turn off these suggestions, and where are they coming from?).

Possible solution:

It looks like setting "javascript.suggest.names": false completely removes the dropdown list when using a period in a parenthesis, and allows me to also put in custom emmet abbreviations now within a return statement in a React component.

Is there a better way than doing this?

Does this issue occur when all extensions are disabled?: Yes

@vscodebot vscodebot bot added the emmet Emmet related issues label Jan 4, 2019
@webdevpchoi webdevpchoi changed the title Emmet suggestions clashing with text editor suggestions? Intellisense suggestion prevents emmet suggestions from appearing? Jan 4, 2019
@webdevpchoi webdevpchoi changed the title Intellisense suggestion prevents emmet suggestions from appearing? Intellisense Global Identifier suggestion prevents Emmet suggestions from appearing/working properly Jan 4, 2019
@ramya-rao-a
Copy link
Contributor

Thanks for reporting @webdevpchoi

Is there a better way than doing this?

For now, after step 4 (in your initial set of steps), when you see the Global identifier in the suggestion list, press escape to get rid of the suggestions, and keep typing. You will see the suggestions again and this time it will include emmet suggestions.

Why is this happening?

When user types div. there are no emmet suggestions (which is expected), but there are suggestions from the javascript extension (which can be disabled using the javascript.suggest.names setting). #32423 tracks exactly the same issue but with the php instead of javascript.

The main root cause is #13735 which has been marked as out of scope.

@octref To fix this particular case, we can update the vscode-emmet-helper to return <div class=""></div> for the abbreviation div.

@ramya-rao-a ramya-rao-a added the bug Issue identified by VS Code Team member as probable bug label Jan 9, 2019
@ramya-rao-a ramya-rao-a assigned octref and unassigned ramya-rao-a Jan 9, 2019
@octref octref added this to the December/January 2019 milestone Jan 9, 2019
@octref
Copy link
Contributor

octref commented Jan 16, 2019

@ramya-rao-a I think we need to trigger completion on . and return <div class=""></div>. Emmet users usually ignore the div.
When in . we missed the chance, users who continue to type .foo won't get emmet completions.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jan 17, 2019

I think we need to trigger completion on .

Emmet completion provider is definitely triggered at this point.

and return "<div class="">."

Yes, thats what I mentioned in the previous comment....

@octref
Copy link
Contributor

octref commented Jan 17, 2019

@ramya-rao-a Nope, I meant on typing .inventory's first ., not the last dot on div..

At this point, Emmet did not participate on first dot and loses chances to update completion list.

image

Although it does have completions, if you re-trigger it with Ctrl+Space.

image

But I don't know what's a reliable way to tell if the . is triggered on JSX but not the JS part.

@octref
Copy link
Contributor

octref commented Jan 17, 2019

Here's how it works now. I fixed the general issue of completion list disappear when typing the dot in span.foo too (it'll reappear after t, but I didn't like the disappear-appear).

completion

@mjbvz mjbvz added the verified Verification succeeded label Jan 31, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 3, 2019
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@octref @mjbvz @ramya-rao-a @webdevpchoi and others