From 648402c305dd2d040c4dcd6eaa5508871532c96f Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Sun, 9 Aug 2026 19:07:32 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=8B=F0=9F=94=A7=EF=BC=9Ainstall=20?= =?UTF-8?q?ripgrep=20so=20Todo=20Tree=20can=20find=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The extension fails to start on every attach: Todo-Tree: Failed to find vscode-ripgrep - please install ripgrep manually and set 'todo-tree.ripgrep' to point to the executable It resolves `rg` by trying, in order, the configured todo-tree.ripgrep path, then four hardcoded locations under vscode.env.appRoot: node_modules and node_modules.asar.unpacked, each joined with either vscode-ripgrep/bin/rg or @vscode/ripgrep/bin/rg. Current VS Code ships @vscode/ripgrep-universal/bin//rg instead, so all four miss, and with nothing configured the extension gives up. Two things are needed, because every one of those probes is a bare fs.existsSync and none of them consults PATH: - Install the binary. Debian trixie packages ripgrep 14.1.1, so it joins fish in the Dockerfile's existing apt call for the same reason fish is there: one apt call for something the distribution already has, baked into a cached layer, no feature required. - Point todo-tree.ripgrep at /usr/bin/rg. Installing alone would not have fixed anything. The setting goes in devcontainer.json rather than .vscode/settings.json because it is an absolute container path, and that file is shared with anyone opening the repo outside this container -- where /usr/bin/rg is usually wrong. That is harmless in practice, since a failed existsSync just falls through to the next candidate, but it would still be asserting something untrue of that environment. This is the same split #1779 landed for dprint.path. Not pinned, per the DL3008 note already in this file: Debian drops superseded versions, so a pin would fail the build at the first security update, and nothing raises PRs for apt pins the way renovate does elsewhere here. Co-Authored-By: Claude Sonnet 5 --- .devcontainer/Dockerfile | 32 ++++++++++++++++++++++---------- .devcontainer/devcontainer.json | 15 ++++++++++++++- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e2c3ceed5..4eae17a62 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,17 @@ -# Everything else comes from features. This exists only because fish does not -# need a feature: Debian trixie ships fish 4.0.2, so installing it is one apt -# call, and doing it here bakes it into a cached image layer. +# Everything else comes from features. This exists only for packages that do +# not need one: Debian trixie ships both fish (the default shell, per +# devcontainer.json) and ripgrep, so installing them is one apt call, and +# doing it here bakes them into a cached image layer. +# +# ripgrep is here for the Todo Tree extension, which shells out to an `rg` +# binary. It used to find one inside VS Code itself, but it only ever probes +# four hardcoded paths under vscode.env.appRoot -- node_modules and +# node_modules.asar.unpacked, each joined with vscode-ripgrep/bin/rg or +# @vscode/ripgrep/bin/rg -- and VS Code now ships +# @vscode/ripgrep-universal/bin//rg, which matches none of them. Every +# probe is a bare fs.existsSync, so the extension never consults PATH; +# installing the binary is necessary but not sufficient, and +# devcontainer.json has to point todo-tree.ripgrep at it explicitly. # # The alternative considered was ghcr.io/devcontainers-extra/features/fish-apt-get, # which downloads the 20 MB nanolayer binary and runs it as root to invoke a @@ -8,14 +19,15 @@ # size of the package it installs, for a package the distribution already has. FROM mcr.microsoft.com/devcontainers/typescript-node:5-24-trixie@sha256:b55b444f6658dd2370d430c12d4bc9540c8ed0d3d5b05e4c247161173666954f -# DL3008 wants `fish=4.0.2-1`. Pinning an apt package is not the same bargain -# as pinning an npm one: Debian drops superseded versions from the archive, so -# the first security update to fish would leave this asking for a version that -# no longer exists and fail the build outright. Nothing tracks apt pins to -# raise a PR the way renovate does for everything else here. The previous -# Dockerfile suppressed this same rule for the same reason. +# DL3008 wants these pinned, as in `fish=4.0.2-1`. Pinning an apt package is +# not the same bargain as pinning an npm one: Debian drops superseded versions +# from the archive, so the first security update to either package would leave +# this asking for a version that no longer exists and fail the build outright. +# Nothing tracks apt pins to raise a PR the way renovate does for everything +# else here. The previous Dockerfile suppressed this same rule for the same +# reason. # skipcq: DOK-DL3008 RUN apt-get update \ - && apt-get install -y --no-install-recommends fish \ + && apt-get install -y --no-install-recommends fish ripgrep \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c9c8556bd..5e2a7988c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -61,7 +61,20 @@ "path": "fish" } }, - "terminal.integrated.defaultProfile.linux": "fish" + "terminal.integrated.defaultProfile.linux": "fish", + + // Where the Dockerfile's apt install puts ripgrep. Todo Tree probes + // only four hardcoded paths inside VS Code itself and never looks at + // PATH, so installing the binary does not on its own make the + // extension find it -- see the Dockerfile for the full reasoning. + // + // This lives here rather than in .vscode/settings.json because it is + // an absolute container path. That file is shared with anyone opening + // the repo outside this container, where /usr/bin/rg is usually wrong + // (Homebrew puts it in /opt/homebrew/bin). Being wrong there is + // harmless -- the extension falls through on a failed existsSync -- + // but it would be stating something untrue of that environment. + "todo-tree.ripgrep": "/usr/bin/rg" }, "extensions": [ // https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments From 2c084bd3060c18ec2e813bc165bf5354a7b5441c Mon Sep 17 00:00:00 2001 From: Derek Lewis Date: Sun, 9 Aug 2026 19:37:40 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=8B=F0=9F=94=A7=EF=BC=9Afix=20the?= =?UTF-8?q?=20todo-tree.ripgrep=20setting=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 648402c installed rg and pointed Todo Tree at it, but got the setting name wrong: it set `todo-tree.ripgrep`, when the extension actually resolves the path via `getConfiguration("todo-tree.ripgrep").ripgrep` -- a config *section* lookup, not a leaf key. That call resolves to the setting ID `todo-tree.ripgrep.ripgrep`, per the extension's own package.json schema. VS Code silently drops unknown setting keys, so the wrong one never reached the extension; it fell through to its hardcoded vscode-ripgrep/@vscode/ripgrep probes, which still miss under current VS Code's @vscode/ripgrep-universal layout, and gave up with the same error the previous commit was meant to fix. Co-Authored-By: Claude Sonnet 5 --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5e2a7988c..cfa3db582 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -74,7 +74,7 @@ // (Homebrew puts it in /opt/homebrew/bin). Being wrong there is // harmless -- the extension falls through on a failed existsSync -- // but it would be stating something untrue of that environment. - "todo-tree.ripgrep": "/usr/bin/rg" + "todo-tree.ripgrep.ripgrep": "/usr/bin/rg" }, "extensions": [ // https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments