Skip to content

JSON files not scanned for tags #102

Description

@amorenojr

Description

The extension fails to scan config and data files (e.g. .json) that are not conventionally associated with source code, even when those files contain valid tag syntax and are explicitly included via better-todo-tree.filtering.includeGlobs. Source code file types such as .cs, .py, and .xml are scanned correctly without any explicit include settings.

The distinction appears to be between files with a recognized source-language ID in VS Code versus config/data file types, the latter are silently skipped regardless of include configuration.


Version Info

Visual Studio Code

Version: 1.126.0 (system setup)
Commit: 7e7950df89d055b5a378379db9ee14290772148a
Date: 2026-06-23T01:46:13Z
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Windows_NT x64 10.0.26200

Extension

fanaticpythoner.better-todo-tree-1.2.3-win32-x64

Extension Settings

"better-todo-tree.filtering.includeHiddenFiles": true,
"better-todo-tree.tree.showCountsInTree": true,
"better-todo-tree.general.tags": [
    "NOTE",
    "TODO",
    "BUG",
    "HACK",
    "FIXME",
    "XXX",
    "[ ]",
    "[x]"
],
"better-todo-tree.highlights.defaultHighlight": {
    "type": "text-and-comment",
    "gutterIcon": true,
    "background": "#ff000000"
},
"better-todo-tree.highlights.customHighlight": {
    "NOTE": {
        "icon": "bookmark",
        "foreground": "#000000",
        "background": "#f2ff00",
        "iconColour": "#f2ff00"
    },
    "TODO": {
        "icon": "tasklist",
        "foreground": "#ffa200",
        "iconColour": "#ffa200"
    },
    "BUG": {
        "icon": "bug",
        "foreground": "#ff0000",
        "iconColour": "#ff0000"
    },
    "HACK": {
        "icon": "tools",
        "foreground": "#00a2ff",
        "iconColour": "#00a2ff"
    },
    "FIXME": {
        "icon": "flame",
        "foreground": "#ff00ff",
        "iconColour": "#ff00ff"
    },
    "XXX": {
        "icon": "x",
        "foreground": "#000000",
        "background": "#ffffff",
        "iconColour": "#ffffff"
    },
    "[ ]": {
        "icon": "issue-draft",
        "foreground": "#00ffc8",
        "iconColour": "#00ffc8"
    },
    "[x]": {
        "icon": "check-circle-fill",
        "foreground": "#119400",
        "iconColour": "#119400"
    }
}

Steps to Reproduce

Primary Test

  1. Create a workspace containing a mix of file types, all with valid tag syntax in commented sections:
    • Config/data files (affected):
      • .json: comment prefix // (configured language)
      • .jsonc: comment prefix // (configured language)
    • Source code files (unaffected):
      • .cs, .py, .xml, etc.
  2. Open the extension panel and scan the workspace.
  3. Observe that only the source code file types appear in the results. JSON files are absent despite containing valid tags.

Secondary Test (Rules Out includeGlobs as a Workaround)

Repeat steps 1–3 with the following added to settings.json:

"better-todo-tree.filtering.includeGlobs": [
    "**/*.json",
    "**/*.jsonc"
]

Observe that the JSON files are still not scanned. The explicit glob includes have no effect, which rules out a missing include as the root cause.


Evidence

Primary Test

Image

Secondary Test

Image

Expected Behavior

All text files in the workspace, regardless of file type, should be scanned for tags by default. Explicit glob includes via better-todo-tree.filtering.includeGlobs should unconditionally add file types to the scan scope, overriding any internal filtering.


Actual Behavior

JSON file types are silently excluded from scans. Explicit includeGlobs entries for these file types have no effect.


Original todo-tree Extension Behavior

The original todo-tree extension scanned all text files regardless of file type and respected all glob patterns, including those for config and data files. This extension should match that behavior unless explicitly configured otherwise.


Proposed Solution

The extension's default scan scope should include all text files, not just those with recognized source-language IDs. At minimum, explicit entries in better-todo-tree.filtering.includeGlobs should always be honored, giving users a reliable way to opt specific file types into scanning.

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