estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.85k stars 69 forks source link

Issue: slowing down of VSCode and never-ending "Processing" in status bar. #801

Closed davidsneighbour closed 3 weeks ago

davidsneighbour commented 2 months ago

Describe the bug

Sorry if this bug description is not too helpful; let me know anything or button to push or type to get behind the issue:

The plugin is somehow freezing after the first save. The only reason why I think it is FrontMatter is that, after disabling, everything works fine ;) And the status bar item running "Processing" without end is named Frontmatter.

I had Github's Copilot plugin under suspicion, or maybe an interaction between the two? It started with version 10.0.0 I think, but I was suspecting other factors (keyboard, copilot, linting plugins on save) before I ended up with Frontmatter in my eyes.

To recreate (hopefully) the situation, do this:

Switching FrontMatter off (leaving all other plugins active) leads to a normal typing experience with no sluggishness.

Screenshots

"Processing"

Selection_001

Tooltip_001

Desktop (please complete the following information):

The output log has no visible info about issues:

["INFO" - 16:04:49]  Processing "/content/pagefolders/blog.json" config file.
["INFO" - 16:04:49]  Processing "/content/pagefolders/components.json" config file.
["INFO" - 16:04:49]  Processing "/content/pagefolders/tags.json" config file.
["INFO" - 16:04:49]  Processing "/content/placeholders/permalink.json" config file.
["INFO" - 16:04:49]  Processing "/content/snippets/caption.json" config file.
["INFO" - 16:04:49]  Processing "/custom/scripts/screenshot.json" config file.
["INFO" - 16:04:49]  Processing "/custom/scripts/unsplash.json" config file.
["INFO" - 16:04:49]  Processing "/custom/scripts/youtube.json" config file.
["INFO" - 16:04:49]  Processing "/data/files/kurzschnitte.json" config file.
["INFO" - 16:04:49]  Processing "/data/files/music2program2.json" config file.
["INFO" - 16:04:49]  Processing "/data/folders/blog.json" config file.
["INFO" - 16:04:49]  Processing "/data/media/test.json" config file.
["INFO" - 16:04:49]  Processing "/data/types/sample.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/blog.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/component.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/default.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/music2program2.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/notes-from-the-laboratory.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/contenttypes/tag.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/fieldgroups/author.json" config file.
["INFO" - 16:04:49]  Processing "/taxonomy/fieldgroups/resources.json" config file.
["INFO" - 16:04:49]  Reading dynamic config file: /home/patrick/github.com/davidsneighbour/kollitsch.dev/frontmatter.config.cjs
["INFO" - 16:04:49]  Dynamic config file loaded
["INFO" - 16:04:50]  Trigger page update: main
["INFO" - 16:04:50]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 16:04:51]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 16:04:51]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 16:04:52]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 16:04:53]  Cache cleared
["INFO" - 16:04:56]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 16:04:59]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 17:04:05]  Cache cleared
["INFO" - 17:04:08]  Cache cleared
["INFO" - 17:04:12]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 17:04:26]  Cache cleared
["INFO" - 17:04:21]  Sending message to dashboard: pages
["INFO" - 17:04:21]  Sending message to dashboard: searchReady
["INFO" - 17:04:21]  Sending message to dashboard: loading
["INFO" - 17:04:21]  Sending message to dashboard: pages
["INFO" - 17:04:21]  Sending message to dashboard: searchReady
["INFO" - 17:04:21]  Sending message to dashboard: pages
["INFO" - 17:04:21]  Sending message to dashboard: searchReady
["INFO" - 17:04:21]  Sending message to dashboard: loading
["INFO" - 17:04:21]  Sending message to dashboard: loading
["INFO" - 17:04:21]  Sending message to dashboard: pages
["INFO" - 17:04:21]  Sending message to dashboard: searchReady
["INFO" - 17:04:21]  Sending message to dashboard: loading
["INFO" - 17:04:45]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 17:04:46]  Cache cleared
["INFO" - 17:04:47]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 17:04:50]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md.git
["INFO" - 17:04:53]  Cache cleared
["INFO" - 17:04:58]  Trigger page update: onDidChangeActiveTextEditor

Using "Diagnostic Logging" does not lead to more info either:

["INFO" - 17:04:58]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 17:04:01]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 17:04:03]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:04]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:06]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:48]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:52]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 17:04:53]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:54]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:56]  File saved /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md
["INFO" - 17:04:56]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md
["INFO" - 17:04:56]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:05]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:07]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:08]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:09]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:10]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:10]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:13]  Trigger page update: onDidChangeActiveTextEditor
["INFO" - 17:04:13]  File saved /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md
["INFO" - 17:04:13]  File watcher execution for: /home/patrick/github.com/davidsneighbour/kollitsch.dev/content/blog/2024/cloning-all-my-repos-on-a-new-ubuntu-installation/index.md
["INFO" - 17:04:13]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:15]  Trigger page update: onDidChangeTextEditorSelection
["INFO" - 17:04:18]  Trigger page update: onDidChangeTextEditorSelection
davidsneighbour commented 2 months ago

oops... looked in the wrong place for diagnostic logging:

Project name

kollitsch.dev

Folders

Workspace folder

/home/patrick/github.com/davidsneighbour/kollitsch.dev

Total files

Total files found: 67839

Folders to search files

Complete frontmatter.json config

{
  "$schema": "https://frontmatter.codes/frontmatter.schema.json",
  "frontMatter.config.dynamicFilePath": "[[workspace]]/frontmatter.config.cjs",
  "frontMatter.site.baseURL": "https://kollitsch.dev/",
  "frontMatter.content.pageFolders": [
    {
      "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json",
      "title": "Blog Posts",
      "path": "[[workspace]]/content/blog",
      "contentTypes": [
        "blog",
        "music2program2",
        "notes-from-the-laboratory"
      ],
      "extended": true
    },
    {
      "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json",
      "title": "Components",
      "path": "[[workspace]]/../hugo-modules/modules/**/documentation",
      "contentTypes": [
        "component"
      ],
      "extended": true
    },
    {
      "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json",
      "title": "Tags",
      "path": "[[workspace]]/content/tags",
      "contentTypes": [
        "tag"
      ],
      "extended": true
    }
  ],
  "frontMatter.content.placeholders": [
    {
      "$schema": "https://frontmatter.codes/config/content.placeholders.schema.json",
      "id": "permalink",
      "value": "/blog/{{year}}/{{slug}}/index.md"
    }
  ],
  "frontMatter.content.snippets": {
    "caption": {
      "$schema": "https://frontmatter.codes/config/content.snippets.schema.json",
      "snippet": "{{< caption \"{mediaUrl}\" \"Description\" >}}",
      "sourcePath": "/home/patrick/github.com/davidsneighbour/kollitsch.dev/.frontmatter/config/content/snippets/caption.json"
    }
  },
  "frontMatter.custom.scripts": [
    {
      "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json",
      "command": "~/.nvm/versions/node/v20.4.0/bin/node",
      "script": "./.frontmatter/scripts/screenshot-header-image.js",
      "title": "Retrieve Screenshot"
    },
    {
      "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json",
      "command": "~/.nvm/versions/node/v20.4.0/bin/node",
      "script": "./.frontmatter/scripts/retrieve-unsplash-header-image-info.mjs",
      "title": "Retrieve Unsplash image"
    },
    {
      "$schema": "https://frontmatter.codes/config/custom.scripts.schema.json",
      "title": "Generate social image for Youtube",
      "script": "./.frontmatter/scripts/create-youtube-header-image.js",
      "command": "~/.nvm/versions/node/v20.9.0/bin/node",
      "type": "content"
    }
  ],
  "frontMatter.data.files": [
    {
      "$schema": "https://frontmatter.codes/config/data.files.schema.json",
      "id": "kurzschnitte",
      "title": "Kurzschnitte",
      "file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json",
      "fileType": "json",
      "labelField": "title",
      "singleEntry": false,
      "schema": {
        "title": "Kurzschnitte",
        "type": "object",
        "required": [
          "title",
          "link",
          "slug"
        ],
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "link": {
            "type": "string",
            "title": "Link"
          },
          "description": {
            "type": "string",
            "multiline": true,
            "title": "Description"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "slug": {
            "type": "string",
            "title": "Kurzschnitt-Post"
          }
        }
      }
    },
    {
      "$schema": "https://frontmatter.codes/config/data.files.schema.json",
      "id": "music2program2",
      "title": "Music to program to",
      "file": "[[workspace]]/data/dnb/kollitsch/music.json",
      "fileType": "json",
      "labelField": "name",
      "schema": {
        "title": "Sponsors",
        "type": "object",
        "required": [
          "name",
          "link",
          "slug"
        ],
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "link": {
            "type": "string",
            "title": "Link"
          },
          "description": {
            "type": "string",
            "multiline": true,
            "title": "Description"
          },
          "genre": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  ],
  "frontMatter.data.folders": [
    {
      "$schema": "https://frontmatter.codes/config/data.folders.schema.json"
    }
  ],
  "frontMatter.data.types": [
    {
      "$schema": "https://frontmatter.codes/config/data.types.schema.json"
    }
  ],
  "frontMatter.taxonomy.contentTypes": [
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "name": "blog",
      "previewPath": "yyyy/{{permalink}}",
      "pageBundle": true,
      "filetype": "md",
      "fieldGroup": [
        "resources"
      ],
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string",
          "single": true
        },
        {
          "title": "Description",
          "name": "description",
          "type": "string"
        },
        {
          "title": "Publishing date",
          "name": "date",
          "type": "datetime",
          "default": "{{now}}",
          "format": "yyyy-MM-dd'T'HH:mm:ssxxx",
          "isPublishDate": true
        },
        {
          "title": "Last modified date",
          "name": "lastmod",
          "type": "datetime",
          "default": "{{now}}",
          "format": "yyyy-MM-dd'T'HH:mm:ssxxx",
          "isModifiedDate": true
        },
        {
          "title": "Draft",
          "name": "draft",
          "type": "draft"
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "tags"
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "categories"
        },
        {
          "title": "Resources",
          "name": "resources",
          "type": "block",
          "multiple": true,
          "fieldGroup": [
            "resources"
          ]
        }
      ]
    },
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "fields": []
    },
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "name": "default",
      "previewPath": "{{permalink}}",
      "pageBundle": true,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string",
          "single": true
        },
        {
          "title": "Description",
          "name": "description",
          "type": "string",
          "single": true
        },
        {
          "title": "Publishing date",
          "name": "date",
          "type": "datetime",
          "default": "{{now}}",
          "format": "yyyy-MM-dd'T'HH:mm:ssxxx",
          "isPublishDate": true
        },
        {
          "title": "Last modified date",
          "name": "lastmod",
          "type": "datetime",
          "default": "{{now}}",
          "format": "yyyy-MM-dd'T'HH:mm:ssxxx",
          "isModifiedDate": true
        },
        {
          "title": "Draft",
          "name": "draft",
          "type": "draft"
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "tags"
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "categories"
        },
        {
          "title": "Resources",
          "name": "resources",
          "type": "block",
          "fieldGroup": [
            "resources"
          ]
        }
      ]
    },
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "fields": []
    },
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "fields": []
    },
    {
      "$schema": "https://frontmatter.codes/config/taxonomy.contenttypes.schema.json",
      "fields": []
    }
  ],
  "frontMatter.taxonomy.fieldGroups": [
    {
      "schema": "https://frontmatter.codes/config/taxonomy.fieldgroups.schema.json",
      "id": "author",
      "labelField": "name",
      "fields": [
        {
          "title": "Author Name",
          "name": "name",
          "type": "string",
          "single": true
        },
        {
          "title": "Social link",
          "name": "social",
          "type": "string",
          "single": true
        }
      ]
    },
    {
      "schema": "https://frontmatter.codes/config/taxonomy.fieldgroups.schema.json",
      "id": "resources",
      "labelField": "src",
      "fields": [
        {
          "title": "Path/Filename",
          "name": "src",
          "type": "image",
          "isPreviewImage": true,
          "required": true
        },
        {
          "title": "Title",
          "name": "title",
          "type": "string",
          "single": true
        },
        {
          "title": "Identifier",
          "name": "name",
          "type": "string",
          "single": true
        }
      ]
    }
  ],
  "frontMatter.extends": [
    "https://dnbhub.xyz/frontmatter/settings.global.json"
  ],
  "frontMatter.preview.host": "https://undefined:1313"
}
estruyf commented 2 months ago

@davidsneighbour It has to do with the number of folders to process a change, but we have implemented faster logic. Feel free to give it a try in the latest beta version.

davidsneighbour commented 2 months ago

@estruyf perfect. the processing stopped blocking the editor in the beta version. thanks!