Issue: Creating a snippet does not add it automatically in the frontMatter.content.snippets setting #288

Closed
opened 2026-10-05 02:38:01 +02:00 by adam · 4 comments
Owner

Hi!

I'm using:

VSCode Version: 1.68.0 (user setup)
Front Matter (v.7.3.4)

Steps to reproduce:

  1. I opened FrontMatter Dashboard
  2. I clicked on the Snippets tab
  3. I clicked on the Create Snippet button
  4. In the Create Snippet window, I entered Title, Description and the following text:

itemName
menuName

  1. I saved the snippet. The snippet is now visible under the Snippets tab.
  2. I opened the Settings window and looked for FrontMatter > Content.Snippets.
  3. I clicked on the Edit in settings.jason link and the Settings.jason file opened.
  4. I looked for frontMatter.content.snippets setting.

Result:

FrontMatter did not create the snippet settings in the Settings.jason file - I mean there is no "frontMatter.content.snippets"
declaration at all.

As it is stated in the documentation:

"Once you clicked on the Save button, the snippet is added to the frontMatter.content.snippets setting.
All your placeholders will be automatically extracted and added to the fields property."
(https://frontmatter.codes/docs/snippets)

I tried to add the snippet manually in the Settings.jason file:

"frontMatter.content.snippets": {

  "MyFirstSnippet": {
      "description": "MyFirstSnippet",
      "body": [              
        "[[itemType]]",
        "[[menuName]]"              
      ],
      "fields": [
          {
              "name": "itemType",
              "title": "Item Type",
              "type": "string",                    
              "default": "Customer"
            },
            {
              "name": "menuName",
              "title": "Menu Name",
              "type": "string",
              "default": "General"
            }
      ]
    }

}

However, when I try to use the snippet in some MD file,
the Insert Snippet window does not show the titles of my fields as they are in the Settings.jason
file ("Item Type" and "Menu Name") and there are no prefilled values
(my default: "Customer" and "General") for those fields.

So it seems like FrontMatter does not take into consideration the snippet settings in the Settings. jason file.

Do you have any ideas what could possibly be the reason for the issue?
Thanks in advance!

frontmatter_1
frontmatter_2
frontmatter_3

Hi! **I'm using:** **VSCode Version: 1.68.0 (user setup) Front Matter (v.7.3.4)** Steps to reproduce: 1) I opened **FrontMatter Dashboard** 2) I clicked on the **Snippets** tab 3) I clicked on the **Create Snippet** button 4) In the **Create Snippet** window, I entered **Title**, **Description** and the following text: [[itemName]] [[menuName]] 5) I saved the snippet. The snippet is now visible under the **Snippets** tab. 6) I opened the **Settings** window and looked for **FrontMatter > Content.Snippets**. 7) I clicked on the **Edit in settings.jason** link and the **Settings.jason** file opened. 8) I looked for **frontMatter.content.snippets** setting. **Result:** FrontMatter did not create the snippet settings in the **Settings.jason** file - I mean there is no "frontMatter.content.snippets" declaration at all. As it is stated in the documentation: "Once you clicked on the Save button, the snippet is added to the frontMatter.content.snippets setting. All your placeholders will be automatically extracted and added to the fields property." (https://frontmatter.codes/docs/snippets) I tried to add the snippet manually in the **Settings.jason** file: "frontMatter.content.snippets": { "MyFirstSnippet": { "description": "MyFirstSnippet", "body": [ "[[itemType]]", "[[menuName]]" ], "fields": [ { "name": "itemType", "title": "Item Type", "type": "string", "default": "Customer" }, { "name": "menuName", "title": "Menu Name", "type": "string", "default": "General" } ] } } However, when I try to use the snippet in some MD file, the **Insert Snippet** window does not show the titles of my fields as they are in the **Settings.jason** file ("Item Type" and "Menu Name") and there are no prefilled values (my default: "Customer" and "General") for those fields. So it seems like FrontMatter does not take into consideration the snippet settings in the Settings. jason file. Do you have any ideas what could possibly be the reason for the issue? Thanks in advance! ![frontmatter_1](https://user-images.githubusercontent.com/107546999/173807554-de2d9608-a32b-49b3-b91c-e8cee28d330b.jpg) ![frontmatter_2](https://user-images.githubusercontent.com/107546999/173807558-c889d503-4955-4c3c-83fb-79abe0acee97.jpg) ![frontmatter_3](https://user-images.githubusercontent.com/107546999/173807559-6fe008ae-4c6e-4f76-a517-48132bb8c614.jpg) <!-- github-sync-id:1272030004 -->
adam closed this issue 2026-10-05 02:38:01 +02:00
Author
Owner

Hi @TsvetyD the settings will be stored in the frontmatter.json file. The settings.json file is only used to locally override settings as files from the .vscode folder are not always shared.

You can find the frontmatter.json file at the root of your project.

More information about this can be found here: https://frontmatter.codes/docs/settings#team-settings-and-local-settings

Hi @TsvetyD the settings will be stored in the `frontmatter.json` file. The `settings.json` file is only used to locally override settings as files from the `.vscode` folder are not always shared. You can find the `frontmatter.json` file at the root of your project. More information about this can be found here: https://frontmatter.codes/docs/settings#team-settings-and-local-settings <!-- github-comment-id:1156327440 -->
Author
Owner

Coming back to the issue of using the default property, this is something I haven't been able to reproduce.

I have added your snippet to my frontmatter.json file and this is the output I received:

Screenshot 2022-06-15 at 13 45 49

Does the issue still occur for you when you close the dashboard view and re-open it? That should at least resolve the latest version of the snippets set in your frontmatter.json file or settings.json.

Coming back to the issue of using the `default` property, this is something I haven't been able to reproduce. I have added your snippet to my `frontmatter.json` file and this is the output I received: ![Screenshot 2022-06-15 at 13 45 49](https://user-images.githubusercontent.com/2900833/173821675-e0b24f15-f434-4353-861d-daf9928626be.png) Does the issue still occur for you when you close the dashboard view and re-open it? That should at least resolve the latest version of the snippets set in your `frontmatter.json` file or `settings.json`. <!-- github-comment-id:1156381710 -->
Author
Owner

Thank you SOOOOOOO VERY Much for the quick answer!!!!
:)))

It works!!!
Now everything is fine since I updated the frontmatter.json!!!

frontmatter_4

Case can be closed!!!
Thanks again!!!

Thank you SOOOOOOO VERY Much for the quick answer!!!! :))) It works!!! Now everything is fine since I updated the **frontmatter.json**!!! ![frontmatter_4](https://user-images.githubusercontent.com/107546999/173829779-bd50520b-843a-4f2c-8899-a42b8ad3ad67.jpg) Case can be closed!!! Thanks again!!! <!-- github-comment-id:1156425635 -->
Author
Owner

Thanks @TsvetyD for the update!

Thanks @TsvetyD for the update! <!-- github-comment-id:1157313828 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#288