File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -249,18 +249,23 @@ export async function activate(context: ExtensionContext) {
249249 configService . onConfigChange = function onConfigChange ( event ) {
250250 let settings = this . config . toLanguageServerConfig ( ) ;
251251 updateStatsBar ( this . config . enable ) ;
252- client . sendNotification ( 'workspace/didChangeConfiguration' , { settings } ) ;
252+
253+ if ( client . isRunning ( ) ) {
254+ client . sendNotification ( 'workspace/didChangeConfiguration' , { settings } ) ;
255+ }
253256
254257 if ( event . affectsConfiguration ( 'oxc.configPath' ) ) {
255258 client . clientOptions . synchronize = client . clientOptions . synchronize ?? { } ;
256259 client . clientOptions . synchronize . fileEvents = configService . config . configPath !== null
257260 ? createFileEventWatchers ( configService . config . configPath )
258261 : undefined ;
259262
260- client . restart ( ) . then ( async ( ) => {
261- const configFiles = await findOxlintrcConfigFiles ( ) ;
262- await sendDidChangeWatchedFilesNotificationWith ( client , configFiles ) ;
263- } ) ;
263+ if ( client . isRunning ( ) ) {
264+ client . restart ( ) . then ( async ( ) => {
265+ const configFiles = await findOxlintrcConfigFiles ( ) ;
266+ await sendDidChangeWatchedFilesNotificationWith ( client , configFiles ) ;
267+ } ) ;
268+ }
264269 }
265270 } ;
266271
You can’t perform that action at this time.
0 commit comments