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

Snippets work sporadically. #84

Open
SaifuddinSaifee opened this issue Feb 6, 2023 · 8 comments
Open

Snippets work sporadically. #84

SaifuddinSaifee opened this issue Feb 6, 2023 · 8 comments

Comments

@SaifuddinSaifee
Copy link

Hey folks! I m still facing this issue where I can't see the snippent. I m currently on version 1.2.7
image

But if I declare a variable of any kind, it works just fine, but it becomes quite pointless at that moment:
image

Here's a clip that can explain this to you better:
Simple React Snippets_Issue

Here are my file associations from my user settings:
image

Thanks!

@juanjavier1001
Copy link

@SaifuddinSaifee the same happens to me

@gordianbahri
Copy link

@SaifuddinSaifee @juanjavier1001 and to me.

@martialarturo
Copy link

I also am experiencing this issue.

@emersoncavalcanti1972
Copy link

I believe it is related to the change "JavaScript React language label is now JavaScript JSX". The JavaScript React language mode has been renamed to JavaScript JSX to reflect that JSX syntax is used by more than just React. TypeScript React has also been renamed to TypeScript JSX.

From what I see in the images, it works when the file has the .js extension and stops working with files with the .jsx extension. Please @SaifuddinSaifee confirm us

@SaifuddinSaifee
Copy link
Author

Hey folks, this may sound a bit weird, but ever since I posted this issue on GitHub, the snippets are now working perfectly fine, and surprisingly they work for both .js as well as for .jsx. But I'd like you to know that I haven't changed any of the settings (as of now). But from my previous tests, I can confirm that when the snippets decide not to work, they neither work for .js file nor for .jsx file.
As I said it's sporadic, it's completely unpredictable when this issue appears again.

@SaifuddinSaifee
Copy link
Author

Until we actually come up with a solution, I have found a workaround.
It's a VS Code key-binding settings, that helps you trigger an entire album of snippets. and it's super simple and safe.

ezgif com-video-to-gif

Steps taken in the above video:

  1. Press Ctrl+k+s: This will open up the Key bindings settings
  2. Search for showSnippets in the top search bar, you should see a command as editor.action.showSnippets
  3. Click on the edit button (pencil icon).
  4. Set the key binding (I've set shift+k)

And Voila! now you can trigger snippets whenever and wherever you want, here you'll find every snippet that exists in your environment. All you have to do is now search for that snippet and hit enter. Do let me know if this works for you, or if you encounter any problem.

@gordianbahri
Copy link

@SaifuddinSaifee works for me for now, thanks! I can confirm that it either works or doesn't work at all, no matter if .js or .jsx.

@SaifuddinSaifee
Copy link
Author

@Dotolox, I am glad it works for you now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants