@@ -2,6 +2,7 @@ import * as vscode from "vscode";
22import {
33 isMiseExtensionEnabled ,
44 shouldShowOutdatedToolGutterDecorations ,
5+ shouldShowToolEnvVarsDecorations ,
56 shouldShowToolVersionsDecorations ,
67} from "../configuration" ;
78import type { MiseService } from "../miseService" ;
@@ -31,10 +32,26 @@ export async function showToolVersionInline(
3132 document : vscode . TextDocument ,
3233 miseService : MiseService ,
3334) : Promise < void > {
34- const [ files , tools ] = await Promise . all ( [
35+ const showEnvVars = shouldShowToolEnvVarsDecorations ( ) ;
36+ const [ files , tools , envsWithInfo ] = await Promise . all ( [
3537 miseService . getCurrentConfigFiles ( ) ,
3638 miseService . getCurrentTools ( { useCache : false } ) ,
39+ showEnvVars
40+ ? miseService . getEnvWithInfo ( ) . catch ( ( ) => [ ] )
41+ : Promise . resolve ( [ ] ) ,
3742 ] ) ;
43+
44+ const envVarsByTool = new Map < string , string [ ] > ( ) ;
45+ for ( const env of envsWithInfo ) {
46+ if ( env . tool && env . name ?. toUpperCase ( ) !== "PATH" ) {
47+ const existing = envVarsByTool . get ( env . tool ) ;
48+ if ( existing ) {
49+ existing . push ( env . name ) ;
50+ } else {
51+ envVarsByTool . set ( env . tool , [ env . name ] ) ;
52+ }
53+ }
54+ }
3855 const currentFile = expandPath ( document . uri . fsPath ) ;
3956 if ( ! files . includes ( currentFile ) ) {
4057 return ;
@@ -130,13 +147,22 @@ export async function showToolVersionInline(
130147 }
131148 }
132149
150+ const toolEnvVars = envVarsByTool . get ( cleanedToolName ) ;
151+ const envSuffix = toolEnvVars ?. length
152+ ? ` → ${ toolEnvVars . join ( ", " ) } `
153+ : "" ;
154+
133155 if ( isInline ) {
134156 if ( resolvedInstalled ) {
135- annotations . push ( `${ cleanedToolName } : ${ resolvedVersion } ` ) ;
157+ annotations . push (
158+ `${ cleanedToolName } : ${ resolvedVersion } ${ envSuffix } ` ,
159+ ) ;
136160 }
137161 } else {
138162 annotations . push (
139- resolvedInstalled ? ( resolvedVersion ?? "" ) : "Not installed" ,
163+ resolvedInstalled
164+ ? `${ resolvedVersion ?? "" } ${ envSuffix } `
165+ : "Not installed" ,
140166 ) ;
141167 }
142168 usedTools . push ( cleanedToolName ) ;
0 commit comments