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

Restrict snippets to typescript/javascript #9

Open
gforge opened this issue Jan 15, 2022 · 1 comment
Open

Restrict snippets to typescript/javascript #9

gforge opened this issue Jan 15, 2022 · 1 comment

Comments

@gforge
Copy link

gforge commented Jan 15, 2022

I get index snippet suggestions in Python. I think the snippets should be extended with scope (from googling, https://stackoverflow.com/questions/70426010/how-to-restrict-global-snippets-to-show-only-for-certain-file-extensions-in-vsco):

{
  "@index-export-all": {
    "prefix": "@index-export-all",
    "body": ["@index('./*', f => `export * from '${f.path}'`)"],
    "scope": "javascript,typescript",
    "description": "@index marker"
  },
  "@index-export-default": {
    "prefix": "@index-export-default",
    "body": [
      "@index('./*', f => `export { default as ${f.name} } from '${f.path}'`)"
    ],
    "scope": "javascript,typescript",
    "description": "@index marker"
  },
  "@index-export-image-assets": {
    "prefix": "@index-export-image-assets",
    "body": [
      "@index('./*.{png,jpg,jpeg,svg,gif}', (f, _) => `export { default as img${_.pascalCase(f.name)} } from '${f.path}${f.ext}'`)"
    ],
    "scope": "javascript,typescript",
    "description": "@index marker"
  },
  "@endindex": {
    "prefix": "@endindex",
    "body": ["@endindex"],
    "scope": "javascript,typescript",
    "description": "@endindex marker"
  }
}
@wottpal
Copy link

wottpal commented Dec 6, 2023

I would like to chime in on this. Should be a relatively easy fix! Currently it's very annoying to get suggestions everywhere (even in Copilot Chat windows).

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

2 participants