r5n-dev / vscode-react-javascript-snippets

Extension for React/Javascript snippets with search supporting ES7+ and babel features
MIT License
1.71k stars 440 forks source link

TypeScript props settings have no effect #238

Closed john-TC closed 2 years ago

john-TC commented 2 years ago

The settings reactSnippets.settings.typescript and reactSnippets.settings.typescriptPropsStatePrefix have no effect in .tsx files.

Line 3 should be removed or have interface keyword.

Snippet: tsrafce image

Awesome extension btw.

john-TC commented 2 years ago

So today I changed a setting and a pop up in the bottom right said please reload to apply extension settings. Now I can't change interface back to type. No pop ups. Changing settings.json doesn't do anything. Executing Reload Window from the command palette does nothing. Tried installing and uninstalling.

chillios-dev commented 2 years ago

@john-TC The tricky part with extension activation, it has to be enabled to generate those snippets with options. So first, try to open typescript file, then change option and restart your vscode.

john-TC commented 2 years ago

So I opened a blank instance of VS Code, created a new file with ctrl + n, changed the language mode to TypeScript, and changed a setting. It worked and got the pop up to restart VS Code.

image

It's a problem with VS Code and not with the extension. Thanks for the tip.

john-TC commented 2 years ago

Is it possible to detect settings changes with .tsx files and not only .ts?

chillios-dev commented 2 years ago

@john-TC it detects javascript,javascriptreact,typescript,typescriptreact as language so it will activate on both .ts and .tsx