r5n-labs / vscode-react-javascript-snippets

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

Snippets not working in .jsx files (anfn) #279

Open izznogooood opened 1 year ago

izznogooood commented 1 year ago

When using "anfn"-> tab inside the brackets "{}" anywhere in the jsx component return statement, nothing happens (filename xyz.jsx).

return (
          ..........
          <IconButton
            color="inherit"
            sx={{ ml: 1 }}
            onClick={ () => {} } // wanted result
          >

          <IconButton
            color="inherit"
            sx={{ ml: 1 }}
            onClick={anfn    } // actual result
          >
)

VSCode: 1.74.2 ES7+ React/Redux/React-Native snippets: v4.4.3 (12/25/2022,)

In case of conflicts VScode config: (I tried a hale mary by adding the config array manually and adding html)

{
    "workbench.colorTheme": "Ubuntu Color VSCode Deep Dark",
    "workbench.iconTheme": "material-icon-theme",
    "files.autoSave": "afterDelay",
    "editor.fontSize": 16,
    "editor.fontWeight": "normal",
    "explorer.confirmDelete": false,
    "workbench.startupEditor": "none",
    "emmet.includeLanguages": {
        "vue-html": "html",
        "javascript": "javascriptreact"
    },
    "redhat.telemetry.enabled": false,
    "rainbowTags.allowEverywhere": true,
    "eslint.format.enable": true,
    "auto-rename-tag.activationOnLanguage": [
        "*"
    ],
    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
    },
    "files.exclude": {
        "**/.git": false,
    },
    "[javascript]": {
        "editor.defaultFormatter": "dbaeumer.vscode-eslint"
    },
    "git.enableSmartCommit": true,
    "totalTypeScript.hideAllTips": false,
    "totalTypeScript.hideBasicTips": false,
    "reactSnippets.settings.languageScopes": "typescript,typescriptreact,javascript,javascriptreact,html",
}
darckex commented 1 year ago

The reason for this is the vscode built-in extension TypeScript and JavaScript Language Features, I'm looking for a fix

usmanlubis commented 1 year ago

I found the same problem with this, hope will fix it soon

404-html commented 1 year ago

Meanwhile...

You can search through snippets with ES7 snippet search command which can be run with CMD + Shift + P or just use CMD + Shift + R (CTRL + ALT + R for Windows & Linux) keybinding.