@@ -99,7 +99,7 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
9999 collapsibleState : vscode . TreeItemCollapsibleState . None
100100 }
101101
102- case 'python ' :
102+ case 'pythonCommand ' :
103103 let pyCmd : string [ ] = [ ]
104104 element . command ?. command . forEach ( c => pyCmd . push ( `- ${ c } ` ) )
105105
@@ -109,6 +109,16 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
109109 tooltip : new vscode . MarkdownString ( `**Python Command**\n ${ pyCmd . join ( '\n ' ) } ` ) ,
110110 resourceUri : vscode . Uri . parse ( 'file:///test.py' ) , // Needed to pull in the icon for Python
111111 contextValue : element . kind ,
112+ collapsibleState : vscode . TreeItemCollapsibleState . Collapsed
113+ }
114+
115+ case 'python' :
116+ return {
117+ label : `Python v${ element . version } ` ,
118+ iconPath : vscode . ThemeIcon . File ,
119+ tooltip : '' ,
120+ resourceUri : vscode . Uri . parse ( 'file:///test.py' ) , // Needed to pull in the icon for Python
121+ contextValue : element . kind ,
112122 collapsibleState : vscode . TreeItemCollapsibleState . None
113123 }
114124
@@ -169,8 +179,8 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
169179 break
170180 }
171181
172- let pythonNode : PythonCommandNode = { kind : 'python ' , command : client . config . pythonCommand }
173- result . push ( pythonNode )
182+ let pythonCmdNode : PythonCommandNode = { kind : 'pythonCommand ' , command : client . config . pythonCommand , python : client . app ?. python }
183+ result . push ( pythonCmdNode )
174184
175185 let commandNode : SphinxCommandNode = { kind : 'sphinxCommand' , command : client . config . buildCommand }
176186 result . push ( commandNode )
@@ -205,9 +215,13 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
205215 }
206216 break
207217
218+ case 'pythonCommand' :
219+ let pythonNode : PythonNode = { kind : 'python' , version : element . python }
220+ result . push ( pythonNode )
221+ break
222+
208223 // The following node types have no children
209224 case 'sphinxCommand' :
210- case 'python' :
211225 case 'file' :
212226 }
213227
@@ -220,7 +234,7 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
220234 * @param params Information about the newly created client.
221235 */
222236 private clientCreated ( params : ClientCreatedNotification ) {
223- this . logger . debug ( `sphinx/clientCreated: ${ JSON . stringify ( params . config , undefined , 2 ) } ` )
237+ this . logger . debug ( `sphinx/clientCreated[ ${ params . pid } ] : ${ JSON . stringify ( params . config , undefined , 2 ) } ` )
224238 this . sphinxClients . set ( params . id , new SphinxProcess ( params . config ) )
225239 this . _onDidChangeTreeData . fire ( )
226240 }
@@ -272,14 +286,23 @@ export class SphinxProcessProvider implements vscode.TreeDataProvider<ProcessTre
272286 }
273287}
274288
275- type ProcessTreeNode = ProcessContainerNode | SphinxProcessNode | SphinxBuilderNode | SphinxCommandNode | PythonCommandNode | DirNode | FileNode
289+ type ProcessTreeNode = ProcessContainerNode | SphinxProcessNode | SphinxBuilderNode | SphinxCommandNode | PythonNode | PythonCommandNode | DirNode | FileNode
290+
291+ /**
292+ * Represents a Python node
293+ */
294+ interface PythonNode {
295+ kind : 'python'
296+ version : string | undefined
297+ }
276298
277299/**
278300 * Represents a Python command
279301 */
280302interface PythonCommandNode {
281- kind : 'python '
303+ kind : 'pythonCommand '
282304 command : PythonCommand | undefined
305+ python : string | undefined
283306}
284307
285308/**
0 commit comments