@@ -9,11 +9,7 @@ import { EventEmitter, Extension, Uri } from 'vscode';
99import { NodeLanguageServerActivator } from '../../../client/activation/node/activator' ;
1010import { NodeLanguageServerManager } from '../../../client/activation/node/manager' ;
1111import { ILanguageServerManager } from '../../../client/activation/types' ;
12- import {
13- IApplicationEnvironment ,
14- IApplicationShell ,
15- IWorkspaceService ,
16- } from '../../../client/common/application/types' ;
12+ import { IApplicationShell , ICommandManager , IWorkspaceService } from '../../../client/common/application/types' ;
1713import { WorkspaceService } from '../../../client/common/application/workspace' ;
1814import { PythonSettings } from '../../../client/common/configSettings' ;
1915import { ConfigurationService } from '../../../client/common/configuration/service' ;
@@ -32,7 +28,7 @@ suite('Pylance Language Server - Activator', () => {
3228 let settings : IPythonSettings ;
3329 let extensions : IExtensions ;
3430 let appShell : IApplicationShell ;
35- let appEnv : IApplicationEnvironment ;
31+ let commandManager : ICommandManager ;
3632 let extensionsChangedEvent : EventEmitter < void > ;
3733
3834 let pylanceExtension : Extension < any > ;
@@ -44,12 +40,10 @@ suite('Pylance Language Server - Activator', () => {
4440 settings = mock ( PythonSettings ) ;
4541 extensions = mock < IExtensions > ( ) ;
4642 appShell = mock < IApplicationShell > ( ) ;
47- appEnv = mock < IApplicationEnvironment > ( ) ;
48- when ( appEnv . uriScheme ) . thenReturn ( 'scheme' ) ;
43+ commandManager = mock < ICommandManager > ( ) ;
4944
5045 pylanceExtension = mock < Extension < any > > ( ) ;
5146 when ( configuration . getSettings ( anything ( ) ) ) . thenReturn ( instance ( settings ) ) ;
52- when ( appEnv . uriScheme ) . thenReturn ( 'scheme' ) ;
5347
5448 extensionsChangedEvent = new EventEmitter < void > ( ) ;
5549 when ( extensions . onDidChange ) . thenReturn ( extensionsChangedEvent . event ) ;
@@ -61,7 +55,7 @@ suite('Pylance Language Server - Activator', () => {
6155 instance ( configuration ) ,
6256 instance ( extensions ) ,
6357 instance ( appShell ) ,
64- instance ( appEnv ) ,
58+ instance ( commandManager ) ,
6559 ) ;
6660 } ) ;
6761 teardown ( ( ) => {
@@ -114,7 +108,7 @@ suite('Pylance Language Server - Activator', () => {
114108 Common . bannerLabelNo ( ) ,
115109 ) ,
116110 ) . once ( ) ;
117- verify ( appShell . openUrl ( `scheme: extension/ ${ PYLANCE_EXTENSION_ID } ` ) ) . never ( ) ;
111+ verify ( commandManager . executeCommand ( ' extension.open' , PYLANCE_EXTENSION_ID ) ) . never ( ) ;
118112 } ) ;
119113
120114 test ( 'When Pylance is not installed activator should open Pylance install page if users clicks Yes' , async ( ) => {
@@ -129,7 +123,7 @@ suite('Pylance Language Server - Activator', () => {
129123 try {
130124 await activator . start ( undefined ) ;
131125 } catch { }
132- verify ( appShell . openUrl ( `scheme: extension/ ${ PYLANCE_EXTENSION_ID } ` ) ) . once ( ) ;
126+ verify ( commandManager . executeCommand ( ' extension.open' , PYLANCE_EXTENSION_ID ) ) . once ( ) ;
133127 } ) ;
134128
135129 test ( 'Activator should throw if Pylance is not installed' , async ( ) => {
0 commit comments