Skip to content

Duplicate snippets in markdown/html/tex/plaintext due to global.json language list including both 'all' and specific filetypes #629

Description

@widdsun

Problem

global.json snippets (date, dateDMY, dateMDY, datetime, etc.) appear twice in completion for markdown, html, tex, and plaintext files.

This is because package.json declares:

{
    "language": ["plaintext", "markdown", "tex", "html", "global", "all"],
    "path": "./snippets/global.json"
}

"all" already applies to every filetype. Listing "markdown", "html", "tex", and "plaintext" explicitly causes snippet engines (e.g. LuaSnip) to register the same snippets under both the global scope and the specific filetype scope, resulting in duplicates.

Other filetypes are unaffected because they only match via "all".

Expected

{
    "language": ["global", "all"],
    "path": "./snippets/global.json"
}

Environment

  • LuaSnip v2 + friendly-snippets (latest)
  • blink.cmp v1 with snippets = { preset = 'luasnip' }
  • require("luasnip.loaders.from_vscode").lazy_load()
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions