22// Licensed under the MIT License.
33
44import { injectable , inject } from 'inversify' ;
5- import { getArchitectureDisplayName } from '../../common/platform/registry' ;
65import { Resource } from '../../common/types' ;
6+ import { Architecture } from '../../common/utils/platform' ;
77import { isParentPath } from '../../pythonEnvironments/common/externalDependencies' ;
88import { EnvironmentType , PythonEnvironment , virtualEnvTypes } from '../../pythonEnvironments/info' ;
99import { PythonVersion } from '../../pythonEnvironments/info/pythonVersion' ;
@@ -111,7 +111,7 @@ function getSortName(info: PythonEnvironment, interpreterHelper: IInterpreterHel
111111 sortNameParts . push ( info . version . raw ) ;
112112 }
113113 if ( info . architecture ) {
114- sortNameParts . push ( getArchitectureDisplayName ( info . architecture ) ) ;
114+ sortNameParts . push ( getArchitectureSortName ( info . architecture ) ) ;
115115 }
116116 if ( info . companyDisplayName && info . companyDisplayName . length > 0 ) {
117117 sortNameParts . push ( info . companyDisplayName . trim ( ) ) ;
@@ -133,6 +133,18 @@ function getSortName(info: PythonEnvironment, interpreterHelper: IInterpreterHel
133133 return `${ sortNameParts . join ( ' ' ) } ${ envSuffix } ` . trim ( ) ;
134134}
135135
136+ function getArchitectureSortName ( arch ?: Architecture ) {
137+ // Strings are choosen keeping in mind that 64-bit gets preferred over 32-bit.
138+ switch ( arch ) {
139+ case Architecture . x64 :
140+ return 'x64' ;
141+ case Architecture . x86 :
142+ return 'x86' ;
143+ default :
144+ return '' ;
145+ }
146+ }
147+
136148function isBaseCondaEnvironment ( environment : PythonEnvironment ) : boolean {
137149 return (
138150 environment . envType === EnvironmentType . Conda &&
0 commit comments