Skip to content
Prev Previous commit
Next Next commit
Issue an event after an internal server restart when testing
  • Loading branch information
thecrypticace committed Apr 7, 2025
commit 1893723550895807866d0aba51bd7225e37f3f68
10 changes: 8 additions & 2 deletions packages/tailwindcss-language-server/src/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,11 +1041,17 @@ export class TW {
this.watched.length = 0
}

restart(): void {
async restart(): void {
let isTestMode = this.initializeParams.initializationOptions?.testMode ?? false

console.log('----------\nRESTARTING\n----------')
this.dispose()
this.initPromise = undefined
this.init()
await this.init()

if (isTestMode) {
this.connection.sendNotification('@/tailwindCSS/serverRestarted')
}
}

async softRestart(): Promise<void> {
Expand Down