File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def main() -> int:
6363 if extension_version != api_version :
6464 print (
6565 f"::error::Version mismatch: package.json is { extension_version } but "
66- f"api/package.json is { api_version } . Update api/package.json to match."
66+ f"api/package.json is { api_version } . Update package.json and/or api/package.json so both versions match."
6767 )
6868 return 1
6969
Original file line number Diff line number Diff line change @@ -1421,15 +1421,13 @@ export namespace PythonEnvironments {
14211421 /**
14221422 * Returns the API exposed by the Python Environments extension in VS Code.
14231423 */
1424- export async function api ( ) : Promise < PythonEnvironmentApi > {
1425- const extension = extensions . getExtension ( EXTENSION_ID ) ;
1426- if ( extension === undefined ) {
1427- throw new Error ( `Python Environments extension is not installed or is disabled` ) ;
1428- }
1429- if ( ! extension . isActive ) {
1430- await extension . activate ( ) ;
1431- }
1432- const pythonEnvsApi : PythonEnvironmentApi = extension . exports ;
1433- return pythonEnvsApi ;
1424+ export async function api ( ) : Promise < PythonEnvironmentApi > {
1425+ const extension = extensions . getExtension < PythonEnvironmentApi > ( EXTENSION_ID ) ;
1426+ if ( extension === undefined ) {
1427+ throw new Error ( `Python Environments extension (${ EXTENSION_ID } ) is not installed or is disabled` ) ;
14341428 }
1429+ if ( ! extension . isActive ) {
1430+ await extension . activate ( ) ;
1431+ }
1432+ return extension . exports ;
14351433}
You can’t perform that action at this time.
0 commit comments