Skip to content

Commit ff40f97

Browse files
committed
Issue an event after an internal server restart when testing
1 parent 1c73ec4 commit ff40f97

File tree

1 file changed

+8
-2
lines changed
  • packages/tailwindcss-language-server/src

1 file changed

+8
-2
lines changed

packages/tailwindcss-language-server/src/tw.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,11 +1041,17 @@ export class TW {
10411041
this.watched.length = 0
10421042
}
10431043

1044-
restart(): void {
1044+
async restart(): void {
1045+
let isTestMode = this.initializeParams.initializationOptions?.testMode ?? false
1046+
10451047
console.log('----------\nRESTARTING\n----------')
10461048
this.dispose()
10471049
this.initPromise = undefined
1048-
this.init()
1050+
await this.init()
1051+
1052+
if (isTestMode) {
1053+
this.connection.sendNotification('@/tailwindCSS/serverRestarted')
1054+
}
10491055
}
10501056

10511057
async softRestart(): Promise<void> {

0 commit comments

Comments
 (0)