michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

Snippets don't work in jxs tag #45

Closed gespispace closed 4 years ago

gespispace commented 5 years ago

I want use ES7 React/Redux/GraphQL/React-Native snippets in jsx tag they don't offered if i turn off the extension offered I find comment with the problem in vscode #33723

michaelgmcd commented 5 years ago

This is a little unclear. The comment you've linked refers to other Babel projects. Are you saying it happens for this one as well?

gespispace commented 5 years ago

Yes, if i turn on this extensions my snippet don't work. And the comment say that work with other Babel projects.

michaelgmcd commented 5 years ago

Does this solution work for you? I was able to install the extension you listed and get it working with "editor.snippetSuggestions": "top" set in my settings.

gespispace commented 5 years ago

Sorry for the late reply.

Yes, this solution work. But i want see Snippets in suggests.

phoydar commented 5 years ago

I'm also experiencing an issue with not seeing common JS snippets inside of JSX. the default js log snippet trigger no longer works and doesn't show up in the Vscode intellisense list when I enable the plugin.

Extension disabled. Outside JSX (Works as expected) image

Extension disabled. Inside JSX (Works as expected) image

Extension enabled. Outside JSX (Works as expected) image

Extension enabled. Inside JSX (Does not work as expected) The intellisense list no longer contains the default log snippet and doesn't show any user JS snippets. image

exocode commented 4 years ago

I also found out, that at some places the snippets are working and some are not: See here, very curious. I hope this video will help:

2020-02-13 12 13 56

michaelgmcd commented 4 years ago

Thanks for the in depth video @exocode. I'll take a look at this when I can.

exocode commented 4 years ago

Thanks for the in depth video @exocode. I'll take a look at this when I can.

Good luck :-)

michaelgmcd commented 4 years ago

@exocode The issue here is that VSCode Language Babel adds two new languages for JSX and JSX Attributes (for several reasons). These snippets need to be applied for those languages as well to be available in JSX. I've created a PR to the repo you referenced to add support. Unfortunately, this will need to be done for any snippet projects. Could be some of your chances to contribute to open source!