Skip to content

Is there a way to use snippets based on the _syntax name_, rather than the _filetype_? #1679

@NullVoxPopuli

Description

@NullVoxPopuli

this really only matters for filetypes with multiple embedded languages,
e.g.:

  • svelte
  • vue
  • angular
  • react jsx / tsx
  • glimmer gjs / gts
  • etc

Namely,

if an outer language is javascript, and an inner language is CSS,
I don't want javascript snippets being suggested in the CSS block (such as <style></style> (in jsx/gjs/svelte/etc)

likewise, is there a way to configure the snippets package.json such that it only allows snippets based on the combination of the language and file type?
for example: we don't want to suggest embedded-language snippets when the filetype does not support embedded languages (such as plain js and plain ts -- no embedded languages allowed usually (unless via template literal strings))

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestsnippetsBuilt-in provider and library for snippetssourcesSpecific source provider or the system as a whole

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions