import { commands , Disposable , ExtensionContext } from 'vscode' ; import * as vscode from 'vscode' ; import { forceLwcTestCaseDebug , forceLwcTestDebugActiveTextEditorTest , forceLwcTestFileDebug , handleDidStartDebugSession , handleDidTerminateDebugSession } from './forceLwcTestDebugAction' ; import { forceLwcTestNavigateToTest } from './forceLwcTestNavigateToTest' ; import { forceLwcTestRefreshTestExplorer } from './forceLwcTestRefreshTestExplorer' ; import { forceLwcTestCaseRun , forceLwcTestFileRun , forceLwcTestRunActiveTextEditorTest , forceLwcTestRunAllTests } from './forceLwcTestRunAction' ; import { forceLwcTestStartWatchingCurrentFile , forceLwcTestStopWatchingAllTests , forceLwcTestStopWatchingCurrentFile } from './forceLwcTestWatchAction' ; param extensionContext export function registerCommands ( extensionContext ) { const forceLwcTestRunAllTestsCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.runAllTests' , forceLwcTestRunAllTests ) ; const forceLwcTestRefreshTestExplorerCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.refreshTestExplorer' , forceLwcTestRefreshTestExplorer ) ; const forceLwcTestNavigateToTestCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.navigateToTest' , forceLwcTestNavigateToTest ) ; const forceLwcTestFileRunCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.file.run' , forceLwcTestFileRun ) ; const forceLwcTestFileDebugCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.file.debug' , forceLwcTestFileDebug ) ; const forceLwcTestCaseRunCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.case.run' , forceLwcTestCaseRun ) ; const forceLwcTestCaseDebugCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.case.debug' , forceLwcTestCaseDebug ) ; const forceLwcTestEditorTitleRunCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.editorTitle.run' , forceLwcTestRunActiveTextEditorTest ) ; const forceLwcTestEditorTitleDebugCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.editorTitle.debug' , forceLwcTestDebugActiveTextEditorTest ) ; const forceLwcTestEditorTitleStartWatchingCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.editorTitle.startWatching' , forceLwcTestStartWatchingCurrentFile ) ; const forceLwcTestEditorTitleStopWatchingCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.editorTitle.stopWatching' , forceLwcTestStopWatchingCurrentFile ) ; const forceLwcTestStopWatchingAllTestsCmd = commands . registerCommand ( 'sfdx.force.lightning.lwc.test.stopWatchingAllTests' , forceLwcTestStopWatchingAllTests ) ; const startDebugSessionDisposable = vscode . debug . onDidStartDebugSession ( handleDidStartDebugSession ) ; const stopDebugSessionDisposable = vscode . debug . onDidTerminateDebugSession ( handleDidTerminateDebugSession ) ; const disposables = Disposable . from ( forceLwcTestRunAllTestsCmd , forceLwcTestRefreshTestExplorerCmd , forceLwcTestNavigateToTestCmd , forceLwcTestFileRunCmd , forceLwcTestFileDebugCmd , forceLwcTestCaseRunCmd , forceLwcTestCaseDebugCmd , forceLwcTestEditorTitleRunCmd , forceLwcTestEditorTitleDebugCmd , forceLwcTestEditorTitleStartWatchingCmd , forceLwcTestEditorTitleStopWatchingCmd , forceLwcTestStopWatchingAllTestsCmd , startDebugSessionDisposable , stopDebugSessionDisposable ) ; extensionContext . subscriptions . push ( disposables ) ; return disposables ; }