@@ -13,20 +13,15 @@ import {
1313 workspace ,
1414} from 'vscode' ;
1515
16- import {
17- ConfigurationParams ,
18- ExecuteCommandRequest ,
19- MessageType ,
20- ShowMessageNotification ,
21- } from 'vscode-languageclient' ;
16+ import { ConfigurationParams , ExecuteCommandRequest , ShowMessageNotification } from 'vscode-languageclient' ;
2217
2318import { Executable , LanguageClient , LanguageClientOptions , ServerOptions } from 'vscode-languageclient/node' ;
2419
2520import { join } from 'node:path' ;
2621import { ConfigService } from './ConfigService' ;
2722import { VSCodeConfig } from './VSCodeConfig' ;
2823import { OxcCommands } from './commands' ;
29- import { runExecutable } from './lsp_helper' ;
24+ import { onClientNotification , runExecutable } from './lsp_helper' ;
3025
3126const languageClientName = 'oxc' ;
3227
@@ -149,25 +144,7 @@ export async function activate(
149144 client = new LanguageClient ( languageClientName , serverOptions , clientOptions ) ;
150145
151146 const onNotificationDispose = client . onNotification ( ShowMessageNotification . type , ( params ) => {
152- switch ( params . type ) {
153- case MessageType . Debug :
154- outputChannel . debug ( params . message ) ;
155- break ;
156- case MessageType . Log :
157- outputChannel . info ( params . message ) ;
158- break ;
159- case MessageType . Info :
160- window . showInformationMessage ( params . message ) ;
161- break ;
162- case MessageType . Warning :
163- window . showWarningMessage ( params . message ) ;
164- break ;
165- case MessageType . Error :
166- window . showErrorMessage ( params . message ) ;
167- break ;
168- default :
169- outputChannel . info ( params . message ) ;
170- }
147+ onClientNotification ( params , outputChannel ) ;
171148 } ) ;
172149
173150 context . subscriptions . push ( onNotificationDispose ) ;
0 commit comments