File tree 1 file changed +10
-5
lines changed
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) {
249
249
configService . onConfigChange = function onConfigChange ( event ) {
250
250
let settings = this . config . toLanguageServerConfig ( ) ;
251
251
updateStatsBar ( this . config . enable ) ;
252
- client . sendNotification ( 'workspace/didChangeConfiguration' , { settings } ) ;
252
+
253
+ if ( client . isRunning ( ) ) {
254
+ client . sendNotification ( 'workspace/didChangeConfiguration' , { settings } ) ;
255
+ }
253
256
254
257
if ( event . affectsConfiguration ( 'oxc.configPath' ) ) {
255
258
client . clientOptions . synchronize = client . clientOptions . synchronize ?? { } ;
256
259
client . clientOptions . synchronize . fileEvents = configService . config . configPath !== null
257
260
? createFileEventWatchers ( configService . config . configPath )
258
261
: undefined ;
259
262
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
+ }
264
269
}
265
270
} ;
266
271
You can’t perform that action at this time.
0 commit comments