Skip to content

Commit 531528b

Browse files
committed
Only register common capabilities once
1 parent fa87e8a commit 531528b

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ export class TW {
174174
}
175175
}
176176

177+
if (results.some((result) => result.status === 'fulfilled')) {
178+
await this.updateCommonCapabilities()
179+
}
180+
177181
await this.listenForEvents()
178182
}
179183

@@ -628,8 +632,6 @@ export class TW {
628632

629633
console.log(`[Global] Initializing projects...`)
630634

631-
await this.updateCommonCapabilities()
632-
633635
// init projects for documents that are _already_ open
634636
let readyDocuments: string[] = []
635637
let enabledProjectCount = 0
@@ -896,6 +898,7 @@ export class TW {
896898
capabilities.add(DidChangeConfigurationNotification.type, undefined)
897899
}
898900

901+
this.commonRegistrations?.dispose()
899902
this.commonRegistrations = await this.connection.client.register(capabilities)
900903
}
901904

0 commit comments

Comments
 (0)