Skip to content

Commit fe92162

Browse files
authored
fix: Normalize v prefix on both sides of version check (#199)
The inline "Not installed" decoration compared a v-stripped requested version against the raw resolved version, so any tool whose resolved version keeps the v prefix (git-sourced pipx entries like pipx:github/owner/repo pinned to a tag such as v0.8.7) was flagged as not installed even when correctly installed and active. Strip the prefix on both sides before the startsWith check so the comparison is symmetric. PyPI-style tools keep working because they have no v prefix to strip.
1 parent cd68a7c commit fe92162

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/providers/inlineToolDecorator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,15 @@ export async function showToolVersionInline(
133133

134134
const reqVersion = extractToolVersionFromLine(lineText, raw);
135135
if (reqVersion && resolvedVersion) {
136+
// Strip a leading `v` from both sides so git-sourced tools
137+
// (e.g. `pipx:github/owner/repo` pinned to a tag like
138+
// `v0.8.7`) are not flagged as "Not installed" when the
139+
// pin and resolved version match modulo the prefix.
136140
const normalizedReq = reqVersion.replace(/^v/, "");
141+
const normalizedResolved = resolvedVersion.replace(/^v/, "");
137142
if (
138143
normalizedReq !== "latest" &&
139-
!resolvedVersion.startsWith(normalizedReq)
144+
!normalizedResolved.startsWith(normalizedReq)
140145
) {
141146
if (isInline) {
142147
continue;

0 commit comments

Comments
 (0)