3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
+ import type { Terminal } from '@xterm/xterm' ;
6
7
import { strictEqual } from 'assert' ;
8
+ import { importAMDNodeModule } from 'vs/amdX' ;
7
9
import { IAction } from 'vs/base/common/actions' ;
10
+ import { Event } from 'vs/base/common/event' ;
8
11
import { isWindows } from 'vs/base/common/platform' ;
12
+ import { URI } from 'vs/base/common/uri' ;
13
+ import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils' ;
14
+ import { TestCommandService } from 'vs/editor/test/browser/editorTestServices' ;
9
15
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
10
16
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService' ;
11
17
import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService' ;
12
18
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
13
19
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock' ;
20
+ import { ILabelService } from 'vs/platform/label/common/label' ;
14
21
import { ILogService , NullLogService } from 'vs/platform/log/common/log' ;
22
+ import { IOpenerService } from 'vs/platform/opener/common/opener' ;
23
+ import { IStorageService } from 'vs/platform/storage/common/storage' ;
15
24
import { ITerminalCommand , TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities' ;
16
25
import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability' ;
17
26
import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore' ;
18
- import { gitSimilar , freePort , FreePortOutputRegex , gitCreatePr , GitCreatePrOutputRegex , GitPushOutputRegex , gitPushSetUpstream , GitSimilarOutputRegex , gitTwoDashes , GitTwoDashesRegex , pwshUnixCommandNotFoundError , PwshUnixCommandNotFoundErrorOutputRegex , pwshGeneralError , PwshGeneralErrorOutputRegex , gitPull , GitPullOutputRegex } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixBuiltinActions' ;
19
- import { TerminalQuickFixAddon , getQuickFixesForCommand } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFixAddon' ;
20
- import { URI } from 'vs/base/common/uri' ;
21
- import type { Terminal } from '@xterm/xterm' ;
22
- import { Event } from 'vs/base/common/event' ;
23
- import { LabelService } from 'vs/workbench/services/label/common/labelService' ;
24
- import { ILabelService } from 'vs/platform/label/common/label' ;
25
- import { OpenerService } from 'vs/editor/browser/services/openerService' ;
26
- import { IOpenerService } from 'vs/platform/opener/common/opener' ;
27
- import { IStorageService } from 'vs/platform/storage/common/storage' ;
28
- import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices' ;
29
- import { ITerminalQuickFixService } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix' ;
30
27
import { ITerminalOutputMatcher } from 'vs/platform/terminal/common/terminal' ;
31
- import { importAMDNodeModule } from 'vs/amdX' ;
32
- import { TestCommandService } from 'vs/editor/test/browser/editorTestServices' ;
33
- import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils' ;
28
+ import { ITerminalQuickFixService } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix' ;
29
+ import { getQuickFixesForCommand , TerminalQuickFixAddon } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFixAddon' ;
30
+ import { freePort , FreePortOutputRegex , gitCreatePr , GitCreatePrOutputRegex , gitPull , GitPullOutputRegex , GitPushOutputRegex , gitPushSetUpstream , gitSimilar , GitSimilarOutputRegex , gitTwoDashes , GitTwoDashesRegex , pwshGeneralError , PwshGeneralErrorOutputRegex , pwshUnixCommandNotFoundError , PwshUnixCommandNotFoundErrorOutputRegex } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixBuiltinActions' ;
31
+ import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices' ;
34
32
35
33
suite ( 'QuickFixAddon' , ( ) => {
36
34
const store = ensureNoDisposablesAreLeakedInTestSuite ( ) ;
37
35
38
36
let quickFixAddon : TerminalQuickFixAddon ;
39
37
let commandDetection : CommandDetectionCapability ;
40
38
let commandService : TestCommandService ;
41
- let openerService : OpenerService ;
42
- let labelService : LabelService ;
39
+ let openerService : IOpenerService ;
40
+ let labelService : ILabelService ;
43
41
let terminal : Terminal ;
44
42
let instantiationService : TestInstantiationService ;
45
43
@@ -59,13 +57,13 @@ suite('QuickFixAddon', () => {
59
57
extensionQuickFixes : Promise . resolve ( [ ] )
60
58
} as Partial < ITerminalQuickFixService > ) ;
61
59
instantiationService . stub ( IConfigurationService , new TestConfigurationService ( ) ) ;
62
- instantiationService . stub ( ILabelService , { } as Partial < ILabelService > ) ;
60
+ labelService = instantiationService . stub ( ILabelService , { } as Partial < ILabelService > ) ;
63
61
const capabilities = store . add ( new TerminalCapabilityStore ( ) ) ;
64
62
instantiationService . stub ( ILogService , new NullLogService ( ) ) ;
65
63
commandDetection = store . add ( instantiationService . createInstance ( CommandDetectionCapability , terminal ) ) ;
66
64
capabilities . add ( TerminalCapability . CommandDetection , commandDetection ) ;
67
65
instantiationService . stub ( IContextMenuService , store . add ( instantiationService . createInstance ( ContextMenuService ) ) ) ;
68
- instantiationService . stub ( IOpenerService , { } as Partial < IOpenerService > ) ;
66
+ openerService = instantiationService . stub ( IOpenerService , { } as Partial < IOpenerService > ) ;
69
67
commandService = new TestCommandService ( instantiationService ) ;
70
68
71
69
quickFixAddon = instantiationService . createInstance ( TerminalQuickFixAddon , [ ] , capabilities ) ;
0 commit comments