Skip to content

Handle when project config is re-created #1300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 7, 2025
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