@@ -2,35 +2,56 @@ import { commands, ExtensionContext, window, workspace } from 'vscode';
22
33import { OxcCommands } from './commands' ;
44import { ConfigService } from './ConfigService' ;
5+ import {
6+ activate as activateFormatter ,
7+ deactivate as deactivateFormatter ,
8+ onConfigChange as onConfigChangeFormatter ,
9+ restartClient as restartFormatter ,
10+ toggleClient as toggleFormatter ,
11+ } from './formatter' ;
512import {
613 activate as activateLinter ,
714 deactivate as deactivateLinter ,
815 onConfigChange as onConfigChangeLinter ,
9- restartClient ,
10- toggleClient ,
16+ restartClient as restartLinter ,
17+ toggleClient as toggleLinter ,
1118} from './linter' ;
1219
1320const outputChannelName = 'Oxc' ;
1421
1522export async function activate ( context : ExtensionContext ) {
1623 const configService = new ConfigService ( ) ;
1724
18- const outputChannel = window . createOutputChannel ( outputChannelName , {
25+ const outputChannelLint = window . createOutputChannel ( outputChannelName + ' (Lint)' , {
26+ log : true ,
27+ } ) ;
28+
29+ const outputChannelFormat = window . createOutputChannel ( outputChannelName + ' (Fmt)' , {
1930 log : true ,
2031 } ) ;
2132
2233 const restartCommand = commands . registerCommand ( OxcCommands . RestartServer , async ( ) => {
23- await restartClient ( ) ;
34+ if ( process . env . SKIP_LINTER_TEST !== 'true' ) {
35+ await restartLinter ( ) ;
36+ }
37+ if ( process . env . SKIP_FORMATTER_TEST !== 'true' ) {
38+ await restartFormatter ( ) ;
39+ }
2440 } ) ;
2541
2642 const showOutputCommand = commands . registerCommand ( OxcCommands . ShowOutputChannel , ( ) => {
27- outputChannel . show ( ) ;
43+ outputChannelLint . show ( ) ;
2844 } ) ;
2945
3046 const toggleEnable = commands . registerCommand ( OxcCommands . ToggleEnable , async ( ) => {
3147 await configService . vsCodeConfig . updateEnable ( ! configService . vsCodeConfig . enable ) ;
3248
33- await toggleClient ( configService ) ;
49+ if ( process . env . SKIP_LINTER_TEST !== 'true' ) {
50+ await toggleLinter ( configService ) ;
51+ }
52+ if ( process . env . SKIP_FORMATTER_TEST !== 'true' ) {
53+ await toggleFormatter ( configService ) ;
54+ }
3455 } ) ;
3556
3657 const onDidChangeWorkspaceFoldersDispose = workspace . onDidChangeWorkspaceFolders ( async ( event ) => {
@@ -47,17 +68,33 @@ export async function activate(context: ExtensionContext) {
4768 showOutputCommand ,
4869 toggleEnable ,
4970 configService ,
50- outputChannel ,
71+ outputChannelLint ,
72+ outputChannelFormat ,
5173 onDidChangeWorkspaceFoldersDispose ,
5274 ) ;
5375
5476 configService . onConfigChange = async function onConfigChange ( event ) {
55- await onConfigChangeLinter ( context , event , configService ) ;
77+ if ( process . env . SKIP_LINTER_TEST !== 'true' ) {
78+ await onConfigChangeLinter ( context , event , configService ) ;
79+ }
80+ if ( process . env . SKIP_FORMATTER_TEST !== 'true' ) {
81+ await onConfigChangeFormatter ( context , event , configService ) ;
82+ }
5683 } ;
5784
58- await activateLinter ( context , outputChannel , configService ) ;
85+ if ( process . env . SKIP_LINTER_TEST !== 'true' ) {
86+ await activateLinter ( context , outputChannelLint , configService ) ;
87+ }
88+ if ( process . env . SKIP_FORMATTER_TEST !== 'true' ) {
89+ await activateFormatter ( context , outputChannelFormat , configService ) ;
90+ }
5991}
6092
6193export async function deactivate ( ) : Promise < void > {
62- await deactivateLinter ( ) ;
94+ if ( process . env . SKIP_LINTER_TEST !== 'true' ) {
95+ await deactivateLinter ( ) ;
96+ }
97+ if ( process . env . SKIP_FORMATTER_TEST !== 'true' ) {
98+ await deactivateFormatter ( ) ;
99+ }
63100}
0 commit comments